Dockerfile with bun for backend
This commit is contained in:
1 parent
79b9bda9ce
commit
a5a41f4c22
1 file changed
+20
@@ -0,0 +1,20 @@
|
|||||||
|
FROM oven/bun:1-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dependencies first (layer caching)
|
||||||
|
# bun install is compatible with npm package.json / package-lock.json
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN bun install --production
|
||||||
|
|
||||||
|
# Copy application source
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Expose backend API port
|
||||||
|
EXPOSE 3001
|
||||||
|
|
||||||
|
# Health check
|
||||||
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
|
||||||
|
CMD bun -e "require('http').get('http://localhost:3001/api/health', r => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))"
|
||||||
|
|
||||||
|
CMD ["bun", "run", "server.js"]
|
||||||
Reference in new issue
Block a user