-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 814 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
35
36
# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim AS web-build
WORKDIR /src
COPY web/package.json web/package-lock.json ./web/
RUN npm --prefix web ci
COPY web/index.html web/tsconfig.json web/vite.config.ts ./web/
COPY web/src ./web/src
RUN npm --prefix web run build
FROM golang:1.24.5-bookworm AS go-build
WORKDIR /src
ENV CGO_ENABLED=0 GOOS=linux
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
COPY web/embed.go ./web/embed.go
COPY web/placeholder ./web/placeholder
COPY --from=web-build /src/web/dist ./web/dist
RUN go build -trimpath -ldflags='-s -w' -o /out/deckhand ./cmd/deckhand
FROM gcr.io/distroless/static-debian12:nonroot AS runtime
WORKDIR /
COPY --from=go-build /out/deckhand /deckhand
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/deckhand"]