/ Dockerfile
Dockerfile
 1  # use the official Bun image
 2  # see all versions at https://hub.docker.com/r/oven/bun/tags
 3  FROM oven/bun AS base
 4  WORKDIR /app
 5  
 6  # install dependencies into temp directory
 7  # this will cache them and speed up future builds
 8  FROM base AS install
 9  
10  # install with --production (exclude devDependencies)
11  RUN mkdir -p /temp/prod
12  COPY Site/package.json Site/bun.lock /temp/prod/
13  RUN cd /temp/prod && bun i --frozen-lockfile -p
14  
15  # copy production dependencies and source code into final image
16  FROM base AS release
17  COPY --from=install /temp/prod/node_modules node_modules
18  COPY Assets Assets
19  COPY Site Site
20  COPY mercury.core.ts mercury.core.ts
21  
22  # build the app
23  WORKDIR /app/Site
24  RUN bun run build
25  
26  # # run the app
27  ENTRYPOINT ["bun", "-b", "./build"]