-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.bun
38 lines (24 loc) · 1.03 KB
/
Dockerfile.bun
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
##################################################
## "build" stage
##################################################
FROM docker.io/oven/bun:1.1.45-debian@sha256:6b5cd8f884dfbdd7364ddd394af49cc1312bfa25b1ddc95fde8790bc035fe60d AS build
ENV BUN_INSTALL=/bun
WORKDIR /src/
COPY ./package.json ./package-lock.json /src/
RUN --mount=type=cache,id=bun,dst=/bun/install/cache/ \
bun install
COPY ./ /src/
RUN --mount=type=cache,id=bun,dst=/bun/install/cache/ \
bun run test:bun
RUN --mount=type=cache,id=bun,dst=/bun/install/cache/ \
bun run build:bundle
##################################################
## "main" stage
##################################################
FROM gcr.io/distroless/cc-debian12:nonroot@sha256:6970a2b2cb07c68f3e15d1b5d2ba857e53da911d5d321f48a842d6b0d26984cf AS main
COPY --from=build --chown=0:0 --chmod=755 /usr/local/bin/bun /bun
COPY --from=build --chown=0:0 --chmod=644 /src/dist/ /app/
WORKDIR /app/
RUN ["/bun", "run", "/app/demergi.js", "--version"]
ENTRYPOINT ["/bun", "run", "/app/demergi.js"]
CMD []