Parcourir la source

Merge branch 'lvyin' of https://github.com/alexcdev1/match-vote-nextjs into lvyin

charles_c il y a 5 mois
Parent
commit
e4c48d3814
2 fichiers modifiés avec 14 ajouts et 16 suppressions
  1. 13 15
      docker-compose.lvyin.yml
  2. 1 1
      nginx/default.conf

+ 13 - 15
docker-compose.lvyin.yml

@@ -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

+ 1 - 1
nginx/default.conf

@@ -3,7 +3,7 @@ server {
     server_name lvyin20.tv www.lvyin20.tv;
     
     location / {
-        proxy_pass http://match-vote-nextjs-nextjs-1:3000;  # 使用完整的容器名称
+        proxy_pass http://match-vote-nextjs-nextjs-lvyin:3000;  # 使用完整的容器名称
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection 'upgrade';