File tree Expand file tree Collapse file tree 7 files changed +55
-49
lines changed
Expand file tree Collapse file tree 7 files changed +55
-49
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Develop CD workflow
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - develop
8+
9+ jobs :
10+ dev-cd :
11+ uses : lemoncode/actions/.github/workflows/aws-ebs.yml@main
12+ with :
13+ files-to-zip : " back/** back/.babelrc front/** front/.babelrc Dockerfile .dockerignore"
14+ dockerArgs : " BASE_API_URL=https://dev.codepaster.net \
15+ BASE_SOCKET_URL=https://dev.codepaster.net"
16+ secrets :
17+ AWS_EB_APP_NAME : ${{secrets.DEV_AWS_EB_APP_NAME}}
18+ AWS_EB_ENV_NAME : ${{secrets.DEV_AWS_EB_ENV_NAME}}
19+ AWS_DEPLOY_ACCESS_KEY_ID : ${{secrets.DEV_AWS_DEPLOY_ACCESS_KEY_ID}}
20+ AWS_DEPLOY_SECRET_ACCESS_KEY : ${{secrets.DEV_AWS_DEPLOY_SECRET_ACCESS_KEY}}
21+ AWS_REGION : ${{secrets.DEV_AWS_REGION}}
22+ AWS_DEPLOY_S3_BUCKET : ${{secrets.DEV_AWS_DEPLOY_S3_BUCKET}}
Original file line number Diff line number Diff line change 1+ name : Production CD workflow
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - master
8+
9+ jobs :
10+ dev-cd :
11+ uses : lemoncode/actions/.github/workflows/aws-ebs.yml@main
12+ with :
13+ files-to-zip : " back/** back/.babelrc front/** front/.babelrc Dockerfile .dockerignore"
14+ dockerArgs : " BASE_API_URL=https://codepaster.net \
15+ BASE_SOCKET_URL=https://codepaster.net"
16+ secrets :
17+ AWS_EB_APP_NAME : ${{secrets.AWS_EB_APP_NAME}}
18+ AWS_EB_ENV_NAME : ${{secrets.AWS_EB_ENV_NAME}}
19+ AWS_DEPLOY_ACCESS_KEY_ID : ${{secrets.AWS_DEPLOY_ACCESS_KEY_ID}}
20+ AWS_DEPLOY_SECRET_ACCESS_KEY : ${{secrets.AWS_DEPLOY_SECRET_ACCESS_KEY}}
21+ AWS_REGION : ${{secrets.AWS_REGION}}
22+ AWS_DEPLOY_S3_BUCKET : ${{secrets.AWS_DEPLOY_S3_BUCKET}}
Original file line number Diff line number Diff line change @@ -26,4 +26,14 @@ COPY ./back/package.json ./
2626COPY ./back/package-lock.json ./
2727RUN npm ci --only=production
2828
29- ENTRYPOINT [ "node" , "index" ]
29+ EXPOSE 3000
30+ ENV PORT=3000
31+ ENV NODE_ENV=production
32+ ENV STATIC_FILES_PATH=./public
33+ ENV MOCK_REPOSITORY=false
34+ ENV CORS_ORIGIN=false
35+ ENV API_URL=/api
36+
37+ RUN npm i pm2 -g
38+
39+ CMD pm2 start ./index.js --name "app" --env production --no-daemon
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import express from 'express';
22import bodyParser from 'body-parser' ;
33import { corsOptions } from './cors'
44import { envConstants } from 'core/constants' ;
5- import { redirectHttpsMiddleware } from './middlewares' ;
65
76export const createApp = ( ) => {
87 const app = express ( ) ;
@@ -11,9 +10,5 @@ export const createApp = () => {
1110 app . use ( bodyParser . json ( ) ) ;
1211 app . use ( corsOptions ) ;
1312
14- if ( envConstants . isProduction ) {
15- app . use ( redirectHttpsMiddleware ) ;
16- }
17-
1813 return app ;
1914} ;
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments