-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
40 lines (33 loc) · 1.1 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
# Use the official Bun image
FROM oven/bun:1.3.10-slim AS base
WORKDIR /usr/src/app
# Install build dependencies for native modules (like better-sqlite3)
# These are required because better-sqlite3 needs to be compiled from source
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies into temp directory
# This will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
COPY apps/www/package.json /temp/dev/apps/www/
COPY packages /temp/dev/packages/
RUN cd /temp/dev && bun install
# Copy node_modules from install stage
# Then copy all source files and build
FROM base AS prerelease
COPY --from=install /temp/dev .
COPY . .
# Build the app
RUN bun docs:build
# Final stage: copy the build output and run the app
FROM base AS release
COPY --from=prerelease /usr/src/app/apps/www/.output .output
COPY --from=prerelease /usr/src/app/apps/www/package.json .
# Expose the port Nuxt runs on
EXPOSE 3000
# Run the app
ENTRYPOINT [ "bun", "run", ".output/server/index.mjs" ]