-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.core
More file actions
44 lines (30 loc) · 932 Bytes
/
Dockerfile.core
File metadata and controls
44 lines (30 loc) · 932 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
37
38
39
40
41
42
43
44
# Dockerfile.core - TypeScript/Bun backend
FROM oven/bun:1.3.6-alpine AS builder
WORKDIR /build
# Copy core package files
COPY core/package.json core/bun.lockb* ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy core source code
COPY core/ ./
# Build the application (creates bundled dist/server.js)
RUN bun run build
# Production stage
FROM oven/bun:1.3.6-alpine
WORKDIR /app
# Install curl for healthcheck
RUN apk add --no-cache curl
# Copy built files from builder
COPY --from=builder /build/dist ./dist
COPY --from=builder /build/package.json ./
# Create directories
RUN mkdir -p /app/data/icons /app/web/dist
# Set environment
ENV NODE_ENV=production
ENV API_PORT=8080
ENV ICONS_DIR=/app/data/icons
ENV WEB_DIST_DIR=/app/web/dist
EXPOSE 8080
CMD ["bun", "dist/server.js"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1