Przeglądaj źródła

آماده سازی برای چندین نمونه فرانت

HgH 1 rok temu
rodzic
commit
b4538dfc31
2 zmienionych plików z 41 dodań i 3 usunięć
  1. 1 1
      Dockerfile
  2. 40 2
      docker-compose.yml

+ 1 - 1
Dockerfile

@@ -40,7 +40,7 @@ WORKDIR /var/www/app/dist/ssr
 RUN yarn install
 
 # Expose the listening port
-EXPOSE 3000
+EXPOSE  ${SSR_PORT}
 
 # Run container as non-root (unprivileged) user
 # The "node" user is provided in the Node.js Alpine base image

+ 40 - 2
docker-compose.yml

@@ -1,7 +1,45 @@
 version: "3.3"
 services:
-  nextjs:
-    build: ./
+  nextjs3000:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3000  # پاس دادن مقدار به آرگومان Dockerfile
+    network_mode: "host"
+    restart: "always"
+  nextjs3001:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3001  # پاس دادن مقدار به آرگومان Dockerfile
+    network_mode: "host"
+    restart: "always"
+  nextjs3002:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3002  # پاس دادن مقدار به آرگومان Dockerfile
+    network_mode: "host"
+    restart: "always"
+  nextjs3003:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3003  # پاس دادن مقدار به آرگومان Dockerfile
+    network_mode: "host"
+    restart: "always"
+  nextjs3004:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3004  # پاس دادن مقدار به آرگومان Dockerfile
+    network_mode: "host"
+    restart: "always"
+  nextjs3005:
+    build:
+      context: .
+      args:
+        SSR_PORT: 3005  # پاس دادن مقدار به آرگومان Dockerfile
     network_mode: "host"
     restart: "always"
 #  nginx: