File tree 5 files changed +42
-1
lines changed
5 files changed +42
-1
lines changed Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM node:22.13.1-alpine
4
+
5
+ RUN apk add --no-cache bash
6
+ RUN apk update
7
+
8
+ ARG RESET_DB_ARG=false
9
+ ENV RESET_DB=$RESET_DB_ARG
10
+ ARG SEED_DATA_ARG=""
11
+ ENV SEED_DATA=$SEED_DATA_ARG
12
+ ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
13
+
14
+ WORKDIR /app
15
+ COPY . .
16
+ RUN npm install pnpm -g
17
+ RUN pnpm install
18
+ RUN pnpm run build
19
+ RUN chmod +x appStartUp.sh
20
+ CMD ./appStartUp.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eo pipefail
3
+
4
+ export DATABASE_URL=$( echo -e ${DATABASE_URL} )
5
+
6
+ echo " Database - running migrations."
7
+ if $RESET_DB ; then
8
+ echo " Resetting DB"
9
+ npx prisma migrate reset --force
10
+ else
11
+ echo " Running migrations"
12
+ npx prisma migrate deploy
13
+ fi
14
+
15
+ # Start the app
16
+ pnpm start:prod
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eo pipefail
3
+ docker buildx build --no-cache=true --build-arg RESET_DB_ARG=<< pipeline.parameters.reset-db>> --build-arg SEED_DATA_ARG=${DEPLOYMENT_ENVIRONMENT} -t ${APPNAME} }:latest .
Original file line number Diff line number Diff line change 17
17
"test:watch" : " jest --watch" ,
18
18
"test:cov" : " jest --coverage" ,
19
19
"test:debug" : " node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand" ,
20
- "test:e2e" : " jest --config ./test/jest-e2e.json"
20
+ "test:e2e" : " jest --config ./test/jest-e2e.json" ,
21
+ "postinstall" : " npx prisma generate"
21
22
},
22
23
"dependencies" : {
23
24
"@nestjs/common" : " ^11.0.1" ,
Original file line number Diff line number Diff line change 1
1
generator client {
2
2
provider = " prisma-client-js "
3
3
previewFeatures = [" extendedIndexes " ]
4
+ binaryTargets = [" native " , " linux-musl-openssl-3.0.x " ]
4
5
}
5
6
6
7
datasource db {
You can’t perform that action at this time.
0 commit comments