mozhi/Dockerfile

22 lines
439 B
Text
Raw Normal View History

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
2023-09-10 12:34:08 +00:00
RUN apk --no-cache add git
COPY . .
2023-09-11 08:45:27 +00:00
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"]