mirror of
https://github.com/ssep1ol/overleaf-registration-be.git
synced 2026-07-21 20:40:21 +00:00
docs: remove goofy sections from README
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -1,11 +1,30 @@
|
||||
FROM golang:1.23-alpine
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
WORKDIR /app
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
ENV GOTOOLCHAIN=local
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go mod init main
|
||||
RUN go mod tidy
|
||||
RUN go build -o app .
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=${TARGETARCH:-$(go env GOARCH)} \
|
||||
go build -trimpath -tags netgo -ldflags="-s -w" -o /out/overleaf-registration-be .
|
||||
|
||||
CMD ["./app"]
|
||||
FROM scratch AS runtime
|
||||
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=build /out/overleaf-registration-be /overleaf-registration-be
|
||||
|
||||
USER 65532:65532
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["/overleaf-registration-be"]
|
||||
|
||||
Reference in New Issue
Block a user