mstar-webserver/Dockerfile
2024-12-30 15:20:25 +01:00

28 lines
462 B
Docker

# syntax=docker/dockerfile:1
FROM golang:1.23 AS build-stage
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
COPY ./templates/ ./templates/
COPY ./well-known/ ./well-known/
COPY ./static/ ./static/
COPY humans.txt ./
COPY robots.txt ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /mstar
FROM scratch AS build-release-stage
WORKDIR /
COPY --from=build-stage /mstar /mstar
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT [ "/mstar" ]