-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 783 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 783 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
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 AS build
WORKDIR /app
COPY package.json bun.lock* ./
# use ignore-scripts to avoid builting node modules like better-sqlite3
RUN bun install --frozen-lockfile --ignore-scripts
# Copy the entire project
COPY . .
RUN bun --bun run docs:build && bun --bun run build
# copy production dependencies and source code into final image
FROM oven/bun:1 AS production
WORKDIR /app
# Only `.output` folder is needed from the build stage
COPY --from=build /app/.output /app
# Copy migration files for database auto-migration
COPY --from=build /app/server/database/migrations /app/server/database/migrations
# run the app
ENTRYPOINT [ "bun", "--bun", "run", "/app/server/index.mjs" ]