2023-08-27 14:51:47 +00:00
|
|
|
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
|
2023-08-27 14:51:47 +00:00
|
|
|
COPY . .
|
|
|
|
|
2023-09-11 08:45:27 +00:00
|
|
|
ENV GOPRIVATE=codeberg.org/aryak/libmozhi
|
2024-07-19 14:55:58 +00:00
|
|
|
#RUN go mod download
|
2023-09-09 14:33:14 +00:00
|
|
|
RUN go run github.com/swaggo/swag/cmd/swag@latest init --parseDependency
|
2023-09-21 16:23:49 +00:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /src/mozhi
|
2023-08-27 14:51:47 +00:00
|
|
|
|
2024-07-19 14:55:58 +00:00
|
|
|
FROM alpine:3.16 AS bin
|
2023-08-27 14:51:47 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /src/mozhi .
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["/app/mozhi", "serve"]
|