-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 861 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 861 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
# syntax = docker/dockerfile:1
# use bun image for throw-away build stage
FROM oven/bun:latest AS build
WORKDIR /app
# install packages needed to build dependencies
RUN apt-get update -qq
RUN apt-get install -y build-essential pkg-config python-is-python3
# copy application code
COPY --link bun.lock package.json ./
COPY --link . .
# install dependencies, lint project, build frontend, and compile backend
RUN bun install --ignore-scripts --frozen-lockfile
RUN bun run biome ci .
RUN --mount=type=secret,id=VITE_API_KEY \
VITE_API_KEY="$(cat /run/secrets/VITE_API_KEY)" bun run build:prod
RUN bun run compile
# minimalist final stage for app image
FROM gcr.io/distroless/base
# copy built application
COPY --from=build /app/main /app/main
COPY --from=build /app/public /app/public
WORKDIR /app
# start the server
EXPOSE 3000
ENTRYPOINT ["./main"]