go-urlsh/Dockerfile

31 lines
496 B
Text
Raw Permalink Normal View History

2024-05-06 16:09:12 +02:00
FROM golang:1.22-alpine AS dev
2023-04-25 21:44:47 +02:00
COPY . /var/app
WORKDIR /var/app
ENV GO111MODULE="on" \
CGO_ENABLED=0 \
GOOS=linux
EXPOSE 80
ENTRYPOINT ["sh"]
FROM dev as build
RUN go mod download && go mod verify
RUN go build -o go-urlsh main.go
RUN chmod +x go-urlsh
FROM scratch AS prod
WORKDIR /var/app
COPY --from=build /var/app/go-urlsh /var/app/
COPY --from=build /var/app/web /var/app/web
2023-04-27 12:35:26 +02:00
COPY --from=build /var/app/views /var/app/views
2023-04-25 21:44:47 +02:00
EXPOSE 80
ENTRYPOINT ["/var/app/go-urlsh"]
2024-05-06 16:09:12 +02:00
CMD ""