Skip to content

Commit 3099f53

Browse files
committed
⚙️ setup: update Dockerfile for health check and graceful shutdown
1 parent 3f9bba8 commit 3099f53

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM oven/bun:1 AS builder
44
WORKDIR /app
55

66
# Copy workspace manifests first for layer caching
7-
COPY package.json bun.lock ./
7+
COPY package.json bun.lock tsconfig.json ./
88
COPY packages/compactor/package.json ./packages/compactor/
99
COPY packages/config/package.json ./packages/config/
1010
COPY packages/core/package.json ./packages/core/
@@ -61,8 +61,11 @@ EXPOSE 3000
6161

6262
# Health check against the API server
6363
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
64-
CMD bun -e "fetch('http://localhost:3000/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"
64+
CMD bun -e "fetch('http://localhost:'+(process.env.PORT||3000)+'/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"
6565

6666
ENV NODE_ENV=production
6767

68+
# The app handles SIGINT for graceful shutdown (not SIGTERM)
69+
STOPSIGNAL SIGINT
70+
6871
ENTRYPOINT ["bun", "run", "start"]

0 commit comments

Comments
 (0)