我创建了这个 docker compose 文件,该文件构建+运行没有错误
version: '3.7'
volumes:
grafana:
driver: local
prometheus-data:
driver: local
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
expose:
- 9090
volumes:
- prometheus-data:/prometheus
- ./prometheus:/etc/prometheus
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yml"
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
expose:
- 3000
volumes:
- grafana:/etc/grafana
restart: unless-stopped
nginx:
image: nginx
container_name: webserver
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /opt/certs/:/etc/nginx/certs/
- ./nginx/gw-web/:/usr/share/nginx/html:ro
- ./nginx/nginx_proxy.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
command: [nginx-debug, '-g', 'daemon off;']
Run Code Online (Sandbox Code Playgroud)
nginx 具有以下反向代理配置:
server {
listen 80;
listen [::]:80;
server_name …Run Code Online (Sandbox Code Playgroud)