-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bun
More file actions
34 lines (25 loc) · 846 Bytes
/
Dockerfile.bun
File metadata and controls
34 lines (25 loc) · 846 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
28
29
30
31
32
33
34
FROM oven/bun@sha256:eaabe9254e5a925135edbd860913a847365345f3a3d0840bfeb58b4e7cce006a AS builder
ENV TINI_VERSION 0.19.0
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static /tini
RUN chmod +x /tini
RUN addgroup -g 10001 \
-S nonroot && \
adduser -u 10000 \
-G nonroot \
-h /home/nonroot \
-S nonroot
WORKDIR /home/nonroot
COPY ./package.json ./bun.lockb ./
RUN bun i --frozen-lockfile \
--production \
--verbose
USER nonroot:nonroot
COPY . .
RUN bun build:prod
FROM gcr.io/distroless/base-nossl-debian12@sha256:a4aea8027706b50f0d79263fd2535bbc93665925521c08040f1ff0968f7211b3
USER nonroot:nonroot
WORKDIR /home/nonroot
COPY --from=builder /tini /tini
ENTRYPOINT ["/tini", "--"]
COPY --from=builder /home/nonroot/app .
CMD [ "./app" ]