forked from databuddy-analytics/Databuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.Dockerfile
More file actions
35 lines (26 loc) · 690 Bytes
/
api.Dockerfile
File metadata and controls
35 lines (26 loc) · 690 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
# Build stage
FROM oven/bun:1.2.20-slim AS builder
WORKDIR /app
# Copy dependency files
COPY package.json bun.lock turbo.json ./
COPY apps/api/package.json ./apps/api/
COPY packages/ ./packages/
# Install dependencies
RUN bun install
# Copy source code
COPY apps/api/ ./apps/api/
FROM oven/bun:1.2.20-slim
WORKDIR /app
# Copy built files from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/api ./apps/api
COPY --from=builder /app/packages ./packages
# Set environment variables
ENV NODE_ENV=production \
PORT=4000 \
BUN_ENV=production
# Expose port
EXPOSE 4000
# Start API
WORKDIR /app/apps/api
CMD ["bun", "run", "src/index.ts"]