Skip to content

Commit f5ff323

Browse files
committed
Merge branch 'main' into anun/docker-question
2 parents 74129fc + c72adbe commit f5ff323

File tree

7 files changed

+65
-15
lines changed

7 files changed

+65
-15
lines changed

backend/collaboration/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"nodemon": "^3.1.4",
3737
"pino-pretty": "^11.2.2",
3838
"ts-node": "^10.9.2",
39-
"tsc-alias": "^1.8.10"
39+
"tsc-alias": "^1.8.10",
40+
"tsx": "^4.19.1"
4041
}
4142
}

backend/question/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"pino-pretty": "^11.2.2",
4545
"ts-node": "^10.9.2",
4646
"tsc-alias": "^1.8.10",
47-
"tsconfig-paths": "^4.2.0"
47+
"tsconfig-paths": "^4.2.0",
48+
"tsx": "^4.19.1"
4849
}
4950
}

backend/user/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ npm run db:prod:migrate
66
# Checks admin table and will not seed if data exists
77
npm run db:prod:seed
88

9+
rm -rf drizzle src tsconfig.json
10+
11+
npm uninstall tsx drizzle-kit
12+
913
npm run start

backend/user/express.Dockerfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ RUN npm run build
99
FROM node:lts-alpine AS production
1010
WORKDIR /data/user-express
1111
COPY --from=build /data/user-express/package*.json ./
12-
RUN npm ci --omit=dev
1312
COPY --from=build --chown=node:node /data/user-express/dist ./dist
1413

14+
RUN npm ci --omit=dev
15+
# For migration
16+
RUN npm install tsx drizzle-kit
17+
COPY drizzle ./drizzle
18+
COPY src/lib/db/ ./src/lib/db
19+
COPY src/lib/passwords ./src/lib/passwords
20+
COPY src/config.ts ./src
21+
COPY tsconfig.json .
22+
COPY entrypoint.sh .
23+
1524
ARG port
1625
EXPOSE ${port}
17-
CMD [ "npm", "run", "start" ]
26+
ENTRYPOINT [ "/bin/sh", "entrypoint.sh" ]

backend/user/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
"jsonwebtoken": "^9.0.2",
3636
"pino": "^9.4.0",
3737
"pino-http": "^10.3.0",
38-
"postgres": "^3.4.4",
39-
"tsx": "^4.19.1"
38+
"postgres": "^3.4.4"
4039
},
4140
"devDependencies": {
4241
"@swc/core": "^1.7.26",
@@ -53,6 +52,7 @@
5352
"regenerator-runtime": "^0.14.1",
5453
"ts-node": "^10.9.2",
5554
"tsc-alias": "^1.8.10",
56-
"tsconfig-paths": "^4.2.0"
55+
"tsconfig-paths": "^4.2.0",
56+
"tsx": "^4.19.1"
5757
}
5858
}

docker-compose.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ services:
7070
container_name: "user-express"
7171
build:
7272
context: ./backend/user
73-
dockerfile: ./express.Dockerfile
74-
target: build
73+
dockerfile: express.Dockerfile
74+
target: production
7575
args:
7676
# For building with the correct env vars
7777
- env=${USER_EXPRESS_ENV}
@@ -91,7 +91,12 @@ services:
9191
networks:
9292
- user-db-network
9393
- user-api-network
94-
entrypoint: ["/bin/sh", "entrypoint.sh"]
94+
healthcheck:
95+
test: wget --no-verbose --tries=1 --spider http://localhost:9001/health || exit 1
96+
interval: 30s
97+
timeout: 10s
98+
retries: 5
99+
start_period: 5s
95100

96101
volumes:
97102
# Persistent Volumes for Databases

package-lock.json

Lines changed: 35 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)