|
@@ -1,49 +1,47 @@
|
|
|
services:
|
|
|
nextjs:
|
|
|
- # container_name: match-vote-nextjs-nextjs-1
|
|
|
+ container_name: match-vote-nextjs-nextjs-lvyin
|
|
|
build:
|
|
|
context: .
|
|
|
dockerfile: Dockerfile.prod
|
|
|
args:
|
|
|
- MONGODB_URI=mongodb://mongodb:27017/lvyin_db
|
|
|
ports:
|
|
|
- - "3000:3000"
|
|
|
+ - "3001:3000"
|
|
|
environment:
|
|
|
- NODE_ENV=production
|
|
|
- MONGODB_URI=mongodb://mongodb:27017/lvyin_db
|
|
|
depends_on:
|
|
|
- mongodb
|
|
|
- restart: unless-stopped # 添加自动重启策略
|
|
|
+ restart: unless-stopped
|
|
|
volumes:
|
|
|
- - uploads_data:/app/public/uploads
|
|
|
+ - lvyin_uploads_data:/app/public/uploads # 修改这里
|
|
|
|
|
|
mongodb:
|
|
|
+ container_name: match-vote-mongodb-lvyin
|
|
|
image: mongo
|
|
|
volumes:
|
|
|
- - mongodb_data:/data/db
|
|
|
- restart: unless-stopped # 添加自动重启策略
|
|
|
+ - lvyin_mongodb_data:/data/db # 修改这里
|
|
|
+ restart: unless-stopped
|
|
|
|
|
|
nginx:
|
|
|
- # container_name: match-vote-nextjs-nginx-1
|
|
|
+ container_name: match-vote-nextjs-nginx-lvyin
|
|
|
image: nginx:alpine
|
|
|
ports:
|
|
|
- "8081:80"
|
|
|
-
|
|
|
volumes:
|
|
|
- ./nginx:/etc/nginx/conf.d
|
|
|
- ./logs/nginx:/var/log/nginx
|
|
|
- - uploads_data:/app/public/uploads:ro
|
|
|
+ - lvyin_uploads_data:/app/public/uploads:ro # 修改这里
|
|
|
- ./certs:/etc/nginx/certs
|
|
|
-
|
|
|
depends_on:
|
|
|
- nextjs
|
|
|
- restart: unless-stopped # 添加自动重启策略
|
|
|
+ restart: unless-stopped
|
|
|
|
|
|
volumes:
|
|
|
- mongodb_data:
|
|
|
- uploads_data:
|
|
|
+ lvyin_mongodb_data:
|
|
|
+ lvyin_uploads_data:
|
|
|
|
|
|
networks:
|
|
|
default:
|
|
|
- # name: match-vote-network # 为网络指定一个名称
|
|
|
-
|
|
|
+ name: match-vote-network-lvyin
|