mozhi/Dockerfile
Arya Kiran 566eb69743
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 3m54s
mozhi pipeline / Build and publish artifacts (push) Successful in 13m27s
update deps, make engine code into a lib
2023-09-09 20:03:14 +05:30

22 lines
467 B
Docker

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git ca-certificates
COPY . .
RUN go mod download
RUN go run github.com/swaggo/swag/cmd/swag@latest init --parseDependency
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/mozhi
FROM alpine:3.16 as bin
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=build /src/mozhi .
EXPOSE 3000
CMD ["/app/mozhi", "serve"]