Skip to content

Commit

Permalink
Fix docker-compose for different ENVs
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Jun 6, 2022
1 parent 21a17a3 commit 59e13ab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ RUN npm ci
RUN npm i -g pm2
RUN npm run build #It will run prebuild script for generating swagger spec by tsoa as well
RUN cp -rv public ./dist
CMD npm run db:migrate:run:staging && cd dist && pm2-runtime src/index.js
17 changes: 0 additions & 17 deletions Dockerfile.production

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ services:
# 1. docker-compose -f docker-compose-production.yml pull
# 2. docker-compose -f docker-compose-production.yml down
# 3. docker-compose -f docker-compose-production.yml up -d
dockerfile: Dockerfile.production
image: ghcr.io/giveth/siweauthmicroservice:main
command: npm run start:server:production
restart: always
environment:
- NODE_ENV=production
Expand Down
1 change: 1 addition & 0 deletions docker-compose-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
# 3. docker-compose -f docker-compose-staging.yml up -d
image: ghcr.io/giveth/siweauthmicroservice:staging
restart: always
command: npm run start:server:staging
environment:
- NODE_ENV=staging
volumes:
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"db:migrate:run:production": "NODE_ENV=production npx typeorm-ts-node-esm migration:run -d ./src/dataSource.ts ",
"db:migrate:revert:local": "NODE_ENV=development npx typeorm-ts-node-esm migration:revert -d ./src/dataSource.ts ",
"db:migrate:run:test": "NODE_ENV=test npx typeorm-ts-node-esm migration:run -d ./src/dataSource.ts ",
"db:migrate:revert:test": "NODE_ENV=test npx typeorm-ts-node-esm migration:revert -d ./src/dataSource.ts "
"db:migrate:revert:test": "NODE_ENV=test npx typeorm-ts-node-esm migration:revert -d ./src/dataSource.ts",
"start:server:staging": "npm run db:migrate:run:staging && cd dist && pm2-runtime src/index.js",
"start:server:production": "npm run db:migrate:run:production && cd dist && pm2-runtime src/index.js"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 59e13ab

Please sign in to comment.