mozhi/Dockerfile
Arya Kiran e584565db7
Some checks reported warnings
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 2m56s
mozhi pipeline / Build and publish artifacts (push) Has been cancelled
make dockerfile copy static and views
2023-09-10 18:04:08 +05:30

23 lines
459 B
Docker

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git
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 /src/mozhi .
COPY --from=build /src/views ./views
COPY --from=build /src/public ./public
EXPOSE 3000
CMD ["/app/mozhi", "serve"]