mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
fixed the healthcheck to actually work
This commit is contained in:
committed by
Aaro Koivukangas
parent
50dd4ea2aa
commit
8f35af289c
@@ -29,6 +29,10 @@ RUN npm run build
|
||||
# NOTE: Has to be alpine3.16 because newer versions have changed a dependency, causing Prisma to fail
|
||||
FROM node:20-alpine3.16 AS node-run
|
||||
|
||||
# healthcheck needs this
|
||||
USER root
|
||||
RUN apk --no-cache add curl
|
||||
|
||||
# following mkdir needs root (for some reason)
|
||||
RUN mkdir -p /usr/src/app/backend/prisma
|
||||
RUN chown node:node /usr/src/app -R
|
||||
|
||||
@@ -7,4 +7,8 @@ router.get('/create-test-users', async (_req, res) => {
|
||||
res.status(200).send()
|
||||
})
|
||||
|
||||
router.get("/ping", async (_req, res) => {
|
||||
return res.status(200).send()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
@@ -19,6 +19,13 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./backend/Dockerfile
|
||||
target: node-run
|
||||
healthcheck:
|
||||
test: curl -f http://localhost:4000/test/ping || exit 1
|
||||
start_period: 10s
|
||||
interval: 30s
|
||||
retries: 3
|
||||
timeout: 15s
|
||||
|
||||
db-anon:
|
||||
container_name: nowdb-db-anon
|
||||
|
||||
Reference in New Issue
Block a user