-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (37 loc) · 1.09 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
50
51
52
FROM oven/bun:1.1-slim AS build
WORKDIR /app
# Install build dependencies for node-pty (native module)
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package.json bun.lockb* ./
# Install dependencies
RUN bun install
# Build node-pty from source for ARM64
RUN cd node_modules/node-pty && \
npm run install
# Copy source files (excluding node_modules via .dockerignore)
COPY . .
# Build the Nuxt application
RUN bun run build
# Production stage
FROM oven/bun:1.1-slim
WORKDIR /app
# Install runtime dependencies for node-pty
RUN apt-get update && apt-get install -y \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Copy built application from build stage
COPY --from=build /app/.output .output
# Copy node-pty native bindings to production
COPY --from=build /app/node_modules/node-pty/build /app/.output/server/node_modules/node-pty/build
# Set environment variables
ENV HOST=0.0.0.0
ENV PORT=3030
ENV NODE_ENV=production
EXPOSE 3030
# Run the production server
CMD ["node", ".output/server/index.mjs"]