2023-08-27 20:21:47 +05:30
|
|
|
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
|
|
|
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
WORKDIR /src
|
2023-09-10 18:04:08 +05:30
|
|
|
RUN apk --no-cache add git
|
2023-08-27 20:21:47 +05:30
|
|
|
COPY . .
|
|
|
|
|
2023-09-11 14:15:27 +05:30
|
|
|
ENV GOPRIVATE=codeberg.org/aryak/libmozhi
|
2023-08-27 20:21:47 +05:30
|
|
|
RUN go mod download
|
2023-09-09 20:03:14 +05:30
|
|
|
RUN go run github.com/swaggo/swag/cmd/swag@latest init --parseDependency
|
2023-09-21 21:53:49 +05:30
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /src/mozhi
|
2023-08-27 20:21:47 +05:30
|
|
|
|
|
|
|
FROM alpine:3.16 as bin
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /src/mozhi .
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["/app/mozhi", "serve"]
|