From a5595d79736cf4f138d516093c01b5f5b46750fe Mon Sep 17 00:00:00 2001 From: SFDKHISSI Date: Thu, 21 Mar 2024 16:27:00 +0100 Subject: [PATCH] using pm2 as a production ready script in the prod-entrypoint --- API/package.json | 1 - API/prod-entrypoint.sh | 4 +++- docker-compose.yaml | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/API/package.json b/API/package.json index 3e59968..14bcdc4 100644 --- a/API/package.json +++ b/API/package.json @@ -22,7 +22,6 @@ "pdfkit": "^0.14.0", "sharp": "^0.33.2", "text-to-image": "^5.2.0", - "forever": "^4.0.3" }, "devDependencies": { "jest": "^29.7.0", diff --git a/API/prod-entrypoint.sh b/API/prod-entrypoint.sh index f2012d9..0586b71 100755 --- a/API/prod-entrypoint.sh +++ b/API/prod-entrypoint.sh @@ -4,4 +4,6 @@ export NODE_ENV=production; npm install --only=production; -forever start index.js; \ No newline at end of file +npm install -g pm2; + +pm2-runtime start index.js; \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 2b97606..1916cb2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,7 @@ services: - "3306" networks: vpcbr: - ipv4_address: 172.23.0.2 + ipv4_address: 172.25.0.2 phpmyadmin: image: phpmyadmin/phpmyadmin restart: unless-stopped @@ -31,7 +31,7 @@ services: - traefik.http.routers.phpmyadminposign.entrypoints=web networks: vpcbr: - ipv4_address: 172.23.0.3 + ipv4_address: 172.25.0.3 depends_on: - database @@ -40,8 +40,8 @@ networks: driver: bridge ipam: config: - - subnet: 172.23.0.0/16 - - gateway: 172.23.0.1 + - subnet: 172.25.0.0/16 + - gateway: 172.25.0.1