This repository was archived by the owner on Feb 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (35 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
49 lines (35 loc) · 1.4 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
# Use official Bun image
FROM oven/bun:1 AS base
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json bun.lock ./
# Install all dependencies (needed for version generation)
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Generate version information (may fail if git is not available, that's ok)
# Ensure version.json exists even if generation fails
RUN bun run generate-version || echo '{"version":"unknown","commitShort":"unknown","commitFull":"unknown","commitCount":0,"branch":"unknown","buildTime":"'$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)'"}' > version.json
# Production stage - only production dependencies
FROM oven/bun:1 AS production
WORKDIR /app
# Copy package files
COPY package.json bun.lock ./
# Install only production dependencies
RUN bun install --frozen-lockfile --production
# Copy source code and generated version file
COPY --from=base /app/src ./src
COPY --from=base /app/public ./public
COPY --from=base /app/tsconfig.json ./tsconfig.json
COPY --from=base /app/bun.d.ts ./bun.d.ts
COPY --from=base /app/version.json ./version.json
# Set production environment
ENV NODE_ENV=production
# Expose port (default 3000, can be overridden via PORT env var)
EXPOSE 3000
# Health check - check if the server responds
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD bun --version || exit 1
# Run the UI server by default
CMD ["bun", "run", "ui"]