just serve static files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
407 B

FROM golang:alpine
RUN apk add --no-cache git upx
COPY go.mod /build/web/
WORKDIR /build/web
RUN go mod download
COPY *.go /build/web/
COPY cmd /build/web/cmd
RUN CGO_ENABLED=0 go build -a -ldflags '-s -w -extldflags "-static"' -o web ./cmd
RUN upx web
RUN mkdir -p /output/var/www /output/bin && cp web /output/bin/
FROM scratch
COPY --from=0 /output/ /
WORKDIR /var/www
EXPOSE 80
ENTRYPOINT ["/bin/web"]