1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-backoffice-v3-api/build/package/api/Dockerfile

26 lines
457 B
Docker

FROM --platform=${BUILDPLATFORM} golang:1.23-alpine3.20 AS builder
ARG BUILDPLATFORM
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /build/backoffice-api ./cmd/api
FROM alpine:3.20 AS runtime
WORKDIR /srv
RUN apk add --no-cache ca-certificates
COPY --from=builder /build/backoffice-api /app/backoffice-api
CMD ["/srv/backoffice-api"]