48 lines
964 B
YAML
48 lines
964 B
YAML
version: '3.8'
|
||
|
||
services:
|
||
admin-frontend:
|
||
build:
|
||
context: .
|
||
dockerfile: Dockerfile
|
||
container_name: dianshang-admin
|
||
restart: unless-stopped
|
||
ports:
|
||
- "80:80"
|
||
- "443:443"
|
||
volumes:
|
||
# SSL证书挂载(如果使用)
|
||
- ./ssl:/etc/nginx/ssl:ro
|
||
# 日志挂载
|
||
- ./logs:/var/log/nginx
|
||
environment:
|
||
- NODE_ENV=production
|
||
networks:
|
||
- dianshang-network
|
||
depends_on:
|
||
- backend
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost/"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
|
||
backend:
|
||
image: your-backend-image:latest # 替换为你的后端镜像
|
||
container_name: dianshang-backend
|
||
restart: unless-stopped
|
||
ports:
|
||
- "8080:8080"
|
||
environment:
|
||
- GO_ENV=production
|
||
networks:
|
||
- dianshang-network
|
||
|
||
networks:
|
||
dianshang-network:
|
||
driver: bridge
|
||
|
||
volumes:
|
||
ssl-certs:
|
||
nginx-logs: |