-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bun
More file actions
39 lines (27 loc) · 687 Bytes
/
Copy pathDockerfile.bun
File metadata and controls
39 lines (27 loc) · 687 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
# Build stage
FROM oven/bun:1-alpine AS builder
# Build arguments
ARG NITRO_PRESET=bun
WORKDIR /app
# Copy package files
COPY package.json bun.lockb* ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build the application with specified preset
ENV NITRO_PRESET=$NITRO_PRESET
RUN bun run build
# Production stage
FROM oven/bun:1-alpine
WORKDIR /app
# Copy built output from builder
COPY --from=builder /app/.output /app/.output
# Expose the port Nitro uses
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV NITRO_PORT=3000
ENV NITRO_HOST=0.0.0.0
# Start the Nitro server
CMD ["bun", "run", ".output/server/index.mjs"]