Skip to content

Commit e9295f1

Browse files
authored
Merge pull request #153 from Lemoncode/develop
Merge to master
2 parents dd72903 + 6b6e793 commit e9295f1

File tree

7 files changed

+55
-49
lines changed

7 files changed

+55
-49
lines changed

.github/workflows/cd.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/dev-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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}}

.github/workflows/prod-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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}}

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ COPY ./back/package.json ./
2626
COPY ./back/package-lock.json ./
2727
RUN 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

back/src/core/servers/express.server.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import express from 'express';
22
import bodyParser from 'body-parser';
33
import { corsOptions } from './cors'
44
import { envConstants } from 'core/constants';
5-
import { redirectHttpsMiddleware } from './middlewares';
65

76
export 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
};

back/src/core/servers/middlewares/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

back/src/core/servers/middlewares/redirect-https.middleware.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)