add docker and use route grouping for API routes

This commit is contained in:
2023-08-27 20:21:47 +05:30
parent f7dc568f72
commit 47b56466ba
4 changed files with 40 additions and 6 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git ca-certificates
COPY . .
RUN go mod download
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/mozhi
FROM alpine:3.16 as bin
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=build /src/mozhi .
EXPOSE 3000
CMD ["/app/mozhi", "serve"]