|
@@ -1,39 +1,3 @@
|
|
|
-# version: '3'
|
|
|
-
|
|
|
-# services:
|
|
|
-# nextjs:
|
|
|
-# build:
|
|
|
-# context: .
|
|
|
-# dockerfile: Dockerfile.prod
|
|
|
-# args:
|
|
|
-# - MONGODB_URI=mongodb://mongodb:27017/mydatabase
|
|
|
-# ports:
|
|
|
-# - "3000:3000"
|
|
|
-# environment:
|
|
|
-# - NODE_ENV=production
|
|
|
-# - MONGODB_URI=mongodb://mongodb:27017/mydatabase
|
|
|
-# depends_on:
|
|
|
-# - mongodb
|
|
|
-
|
|
|
-# mongodb:
|
|
|
-# image: mongo
|
|
|
-# volumes:
|
|
|
-# - mongodb_data:/data/db
|
|
|
-
|
|
|
-# nginx:
|
|
|
-# image: nginx:alpine
|
|
|
-# ports:
|
|
|
-# - "8088:80"
|
|
|
-# volumes:
|
|
|
-# - ./nginx:/etc/nginx/conf.d
|
|
|
-# - ./logs/nginx:/var/log/nginx
|
|
|
-
|
|
|
-# depends_on:
|
|
|
-# - nextjs
|
|
|
-
|
|
|
-# volumes:
|
|
|
-# mongodb_data:
|
|
|
-
|
|
|
services:
|
|
|
nextjs:
|
|
|
container_name: match-vote-nextjs-nextjs-1
|
|
@@ -50,6 +14,9 @@ services:
|
|
|
depends_on:
|
|
|
- mongodb
|
|
|
restart: unless-stopped # 添加自动重启策略
|
|
|
+ volumes:
|
|
|
+ - nextjs-uploads:/app/public/uploads # 添加这行来挂载 uploads volume
|
|
|
+
|
|
|
|
|
|
mongodb:
|
|
|
image: mongo
|
|
@@ -70,6 +37,7 @@ services:
|
|
|
|
|
|
volumes:
|
|
|
mongodb_data:
|
|
|
+ nextjs-uploads:
|
|
|
|
|
|
networks:
|
|
|
default:
|