27 lines
783 B
Docker
27 lines
783 B
Docker
FROM golang:1.26-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
COPY dashboard-server.go .
|
|
RUN go build -ldflags="-s -w" -o server dashboard-server.go
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
COPY --from=builder /app/server /app/server
|
|
COPY index.html /tmp/index.html
|
|
COPY styles.css /app/static/styles.css
|
|
COPY dashboard.js /app/static/dashboard.js
|
|
COPY favicon.svg /app/static/favicon.svg
|
|
COPY favicon-dark.svg /app/static/favicon-dark.svg
|
|
COPY fonts/ /app/static/fonts/
|
|
COPY VERSION /tmp/VERSION
|
|
RUN VERSION=$(cat /tmp/VERSION) && \
|
|
sed "s/?v=VERSION/?v=$VERSION/g" /tmp/index.html > /app/static/index.html
|
|
|
|
EXPOSE 8888
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
CMD wget -qO- http://localhost:8888/health || exit 1
|
|
|
|
CMD ["/app/server"]
|