diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..28cc99a --- /dev/null +++ b/server/Dockerfile @@ -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"] +