-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (22 loc) · 786 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (22 loc) · 786 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
# Build stage runs on the build host and cross-compiles for the target arch,
# so multi-platform builds need no QEMU emulation.
FROM --platform=$BUILDPLATFORM oven/bun:1.3 AS build
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY tsconfig.json ./
COPY src ./src
ARG TARGETARCH
ARG VERSION=dev
RUN case "$TARGETARCH" in \
arm64) target="bun-linux-arm64" ;; \
*) target="bun-linux-x64" ;; \
esac && \
bun build --compile --minify --target="$target" \
--define "BUILD_VERSION=\"$VERSION\"" \
src/index.ts --outfile /app/resend-exporter
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=build /app/resend-exporter /usr/local/bin/resend-exporter
EXPOSE 8080
USER nonroot
ENTRYPOINT ["/usr/local/bin/resend-exporter"]