-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (29 loc) · 1.02 KB
/
Dockerfile
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
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 AS base
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install -y \
git \
unzip
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS builder
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
# Currently hangs because of https://github.com/nrwl/nx/issues/27494
RUN export NX_DAEMON=false NX_ISOLATE_PLUGINS=false && \
bun run build
# copy compiled code into final image
FROM base AS release
# Don't know yet if having node_modules in the final image is needed.
# If it is, we probably should install a production version
# of our dependencies in the builder stage and copy them here.
# COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/dist .
COPY --from=builder /usr/src/app/package.json .
# run the app
USER bun
EXPOSE 4200/tcp
ENTRYPOINT [ "bun", "dist/apps/home/server/server.mjs" ]