ci(release): 🔥 add Dockerfile

This commit is contained in:
pakintada@gmail.com 2024-06-19 15:57:36 +07:00
parent 48d280bab4
commit 0ffc3e89b0

28
server/Dockerfile Normal file
View file

@ -0,0 +1,28 @@
FROM golang:1.21-alpine as builder
WORKDIR /app
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
RUN apk update && apk add build-base
COPY . .
RUN go build -o recipe-manager .
FROM alpine:3.17
WORKDIR /app
RUN apk update && apk add --no-cache sqlite curl
COPY --from=builder /app/recipe-manager .
COPY --from=builder /app/app.env .
COPY --from=builder /app/client_secret.json .
# run the service on container startup.
CMD ["/app/recipe-manager"]