generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. remove additional items, will be added later as an when needed (load, IT) 2. remove nest and use plain express 3. add redux.
- Loading branch information
Showing
78 changed files
with
2,338 additions
and
6,610 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,5 +118,3 @@ test-report.xml | |
**/out | ||
**/target | ||
|
||
# VSCode | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Backend", | ||
"request": "launch", | ||
"runtimeArgs": ["run-script", "dev"], | ||
"runtimeExecutable": "npm", | ||
"skipFiles": ["backend/<node_internals>/**"], | ||
"type": "node", | ||
"cwd": "${workspaceFolder}/backend", | ||
"preLaunchTask": "database" | ||
} | ||
{ | ||
"name": "Frontend", | ||
"request": "launch", | ||
"runtimeArgs": ["run-script", "serve"], | ||
"runtimeExecutable": "npm", | ||
"skipFiles": ["frontend/<node_internals>/**"], | ||
"type": "node", | ||
"cwd": "${workspaceFolder}/frontend" | ||
}, | ||
{ | ||
"name": "Launch Edge", | ||
"type": "msedge", | ||
"request": "launch", | ||
"url": "http://localhost:3001", | ||
"webRoot": "${workspaceFolder}/frontend" | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Launch All", | ||
"configurations": ["Backend", "Frontend", "Launch Edge"], | ||
"stopAll": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".." | ||
}, | ||
{ | ||
"name": "frontend", | ||
"path": "../frontend" | ||
}, | ||
{ | ||
"name": "backend", | ||
"path": "../backend" | ||
} | ||
], | ||
"settings": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"files.exclude": { | ||
"backend": true, | ||
"frontend": true, | ||
"coverage": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"eslint.enable": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "database", | ||
"type": "shell", | ||
"command": "docker-compose up -d migrations", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres?schema=omrr&connection_limit=5" | ||
LOG_LEVEL=silly | ||
IS_RATE_LIMIT_ENABLED=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,40 @@ | ||
# Build static files | ||
# Node Bullseye has npm | ||
FROM node:20.11.0-bullseye-slim AS buildWithDevDeps | ||
FROM node:20.11.0-bullseye-slim AS build | ||
|
||
# Install packages, build and keep only prod packages | ||
WORKDIR /app | ||
COPY *.json ./ | ||
COPY ./src ./src | ||
COPY ./prisma ./prisma | ||
RUN npm ci --ignore-scripts --no-update-notifier | ||
RUN npm run prisma-generate | ||
FROM node:20.11.0-bullseye-slim AS build | ||
RUN npm ci --ignore-scripts && \ | ||
npm run build | ||
|
||
RUN mkdir -p /app/sessions | ||
|
||
FROM node:20.11.0-bullseye-slim AS dependencies | ||
|
||
# Install packages, build and keep only prod packages | ||
WORKDIR /app | ||
COPY *.json ./ | ||
COPY ./src ./src | ||
COPY ./prisma ./prisma | ||
RUN npm ci --ignore-scripts --no-update-notifier --omit=dev | ||
|
||
# COPY over few dependencies from buildWithDevDeps | ||
COPY --from=buildWithDevDeps /app/node_modules/@prisma ./node_modules/@prisma | ||
COPY --from=buildWithDevDeps /app/node_modules/.prisma ./node_modules/.prisma | ||
COPY --from=buildWithDevDeps /app/node_modules/prisma ./node_modules/prisma | ||
RUN npm ci --omit=dev --ignore-scripts | ||
|
||
RUN npm run build | ||
|
||
# Deploy container | ||
# Distroless has node, but not npm | ||
# Deployment container | ||
FROM gcr.io/distroless/nodejs20-debian11:nonroot | ||
ENV NODE_ENV production | ||
|
||
# Copy over app | ||
# Copy over app.ts | ||
WORKDIR /app | ||
COPY --from=build /app/node_modules ./node_modules | ||
COPY --from=dependencies /app/node_modules ./node_modules | ||
COPY --from=build /app/node_modules/@prisma ./node_modules/@prisma | ||
COPY --from=build /app/node_modules/.prisma ./node_modules/.prisma | ||
COPY --from=build /app/node_modules/prisma ./node_modules/prisma | ||
COPY --from=build /app/dist ./dist | ||
COPY --from=build /app/sessions ./sessions | ||
|
||
# Ports, health check and non-root user | ||
# Port and health check | ||
EXPOSE 3000 | ||
HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3000/api || exit 1 | ||
USER nonroot | ||
HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3000 | ||
|
||
# Non-privileged user | ||
USER app | ||
|
||
# Start up command with 50MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. | ||
CMD ["--max-old-space-size=50", "/app/dist/main"] | ||
# Start up command with 250MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. | ||
CMD ["--max-old-space-size=250", "/app/dist/server"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.