-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 802 Bytes
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ---- Build Stage ----
FROM oven/bun:1-alpine AS builder
# Set working directory
WORKDIR /app
# Copy ONLY dependency files first
COPY package.json bun.lockb* ./
# Install deps (this layer is cached unless package files change)
RUN bun install --frozen-lockfile
# NOW copy the rest (source code)
COPY . .
# Build (only re-runs if source code or deps changed)
RUN bun run build
# ---- Runtime Stage ----
FROM oven/bun:1-alpine
# Set working directory
WORKDIR /app
# Copy built dist files from builder
COPY --from=builder /app/dist ./dist
# Expose the port your server runs on (default 3000)
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:3000/s/health || exit 1
# Start the server with Bun
CMD ["bun", "./dist/index.js"]