Skip to content

Commit 4e8971b

Browse files
Merge branch 'master' into password-strength
2 parents 58f776a + b896233 commit 4e8971b

27 files changed

+2350
-66
lines changed

.github/workflows/build_push_registry.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
- 'collab_service/**'
3636
code_execution:
3737
- 'code_execution/**'
38+
api_gateway:
39+
- 'api_gateway/**'
3840
3941
4042
- name: 'Create env file'
@@ -99,6 +101,13 @@ jobs:
99101
docker-compose build code-execution
100102
docker-compose push code-execution
101103
104+
- name: 7. Build and Push api-gateway
105+
id: g
106+
if: steps.changes.outputs.api_gateway == 'true'
107+
run: |
108+
docker-compose build api-gateway
109+
docker-compose push api-gateway
110+
102111
- name: determine deploy step
103112
id: deploy
104113
if: ${{ steps.a.conclusion == 'success' || steps.b.conclusion == 'success' || steps.c.conclusion == 'success' || steps.d.conclusion == 'success' || steps.e.conclusion == 'success' || steps.f.conclusion == 'success' }}

api_gateway/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

api_gateway/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:18-alpine
2+
WORKDIR /usr/src/app
3+
COPY package*.json ./
4+
COPY tsconfig.json ./
5+
RUN npm install
6+
# RUN npm ci --omit=dev
7+
8+
COPY . .
9+
EXPOSE 7998-8000
10+
CMD ["npm", "run", "start"]

api_gateway/Dockerfile.prod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:18-alpine AS builder
2+
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm ci
6+
COPY . .
7+
RUN npm run build
8+
9+
# Stage 2: Setup the production environment
10+
FROM node:18-alpine
11+
WORKDIR /usr/src/app
12+
COPY package*.json ./
13+
RUN npm ci --only=production
14+
COPY --from=builder /app/dist ./dist
15+
EXPOSE 7998-8080
16+
17+
# Command to run the application
18+
CMD ["node", "./dist/index.js"]

api_gateway/nodemon.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
{
3+
"ignore": ["**/*.test.ts", "**/*.spec.ts", "node_modules"],
4+
"watch": ["src"],
5+
"exec": "npm start",
6+
"ext": "ts"
7+
}

0 commit comments

Comments
 (0)