Skip to content

Commit

Permalink
Update Health Check
Browse files Browse the repository at this point in the history
- Node container support healthcheck.
  • Loading branch information
vndroid committed Nov 27, 2023
1 parent 8a4623e commit e1cd8ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN yarn add npm-run-all dotenv prisma semver
RUN set -x \
&& apk add --no-cache curl \
&& yarn add npm-run-all dotenv prisma semver

# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js .
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ services:
db:
condition: service_healthy
restart: always
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
Expand Down

0 comments on commit e1cd8ea

Please sign in to comment.