yw5ncom/Dockerfile
ange 8eacf95dcb
All checks were successful
/ deploy (push) Successful in 46s
feat: variable go version
2024-10-16 14:10:18 +08:00

15 lines
273 B
Docker

ARG VER=1.23
FROM "docker.io/golang:$VER" as build
WORKDIR /app/
ARG VER
COPY main.go .
RUN printf "module yw5n\ngo $VER" > go.mod && CGO_ENABLED=0 go build -o /app
FROM scratch
COPY --from=build /app /app
COPY static/ /static/
COPY html/ /html/
EXPOSE 3000
CMD ["/app"]