-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (30 loc) · 955 Bytes
/
Copy pathDockerfile
File metadata and controls
44 lines (30 loc) · 955 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
37
38
39
40
41
42
43
44
# Frontend Base Image
FROM node:26-alpine AS frontend-build
COPY . /app
WORKDIR /app/frontend
RUN npm install -g @go-task/cli
RUN npm ci
RUN task frontend
# Go Builder
FROM --platform=$BUILDPLATFORM golang:1.26.4-bookworm AS build
ARG VERSION=demo
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY . .
COPY --from=frontend-build /app/frontend/public/assets/css /app/frontend/public/assets/css
COPY --from=frontend-build /app/frontend/public/assets/js/ /app/frontend/public/assets/js/
RUN go mod download
RUN go tool templ generate
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -installsuffix cgo -ldflags "-X main.version=${VERSION} -s -w" -o dist/kiosk .
# Release
FROM gcr.io/distroless/static-debian13:nonroot
ENV TZ=Europe/London
ENV TERM=xterm-256color
ENV DEBUG_COLORS=true
ENV COLORTERM=truecolor
WORKDIR /
COPY --from=build /app/demo.config.yaml .
COPY --from=build /app/dist/kiosk .
USER nonroot
ENTRYPOINT ["/kiosk"]