services: prometheus: image: prom/prometheus:latest command: - --config.file=/etc/prometheus/prometheus.yml - --storage.tsdb.path=/prometheus - --storage.tsdb.retention.time=30d - --storage.tsdb.retention.size=6GB - --web.enable-lifecycle container_name: prometheus restart: unless-stopped ports: - 9090:9090 volumes: - /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - /opt/prometheus/rules:/etc/prometheus/rules:ro - /opt/prometheus:/prometheus environment: []