mozhi/Dockerfile
Arya Kiran 916a22f57b
Some checks failed
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Failing after 36s
mozhi pipeline / Build and publish artifacts (push) Has been cancelled
add arm64 support hopefully (closes #2)
2023-09-21 21:53:49 +05:30

22 lines
439 B
Docker

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git
COPY . .
ENV GOPRIVATE=codeberg.org/aryak/libmozhi
RUN go mod download
RUN go run github.com/swaggo/swag/cmd/swag@latest init --parseDependency
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /src/mozhi
FROM alpine:3.16 as bin
WORKDIR /app
COPY --from=build /src/mozhi .
EXPOSE 3000
CMD ["/app/mozhi", "serve"]