-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (18 loc) · 683 Bytes
/
Copy pathDockerfile
File metadata and controls
20 lines (18 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM docker.io/golang:1.26 AS builder
RUN apt-get update && apt-get install -y make && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY go.mod main.go Makefile ./
# The build context has no .git, so the Makefile's git describe finds nothing;
# the version has to be passed in.
ARG VERSION=dev
RUN make build VERSION=$VERSION
FROM alpine:3.23
RUN apk --no-cache add ca-certificates
RUN adduser -D -h /app appuser
RUN mkdir -p /certs && chown appuser:appuser /certs
WORKDIR /app
COPY --chown=appuser:appuser html /static
COPY --from=builder --chown=appuser:appuser /app/bin/static-httpserver .
USER appuser
ENV ROOT_DIR=/static PORT=8080 TLS_CERT_DIR=/certs
CMD ["./static-httpserver"]