accounts-profiles-endpoint/Dockerfile

25 lines
482 B
Docker
Raw Normal View History

2023-11-17 10:09:45 +05:30
# syntax=docker/dockerfile:1
2024-09-22 18:46:25 +05:30
FROM golang:1.23 AS builder
ARG VERSION=undefined
ARG COMMIT=unknown
2023-11-17 10:09:45 +05:30
COPY . /build
WORKDIR /build
RUN go mod download
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build \
-trimpath \
2024-09-22 18:46:25 +05:30
-ldflags="-w -s -X ely.by/sessionserver/internal/version.version=$VERSION -X ely.by/sessionserver/internal/version.commit=$COMMIT" \
2023-11-17 10:09:45 +05:30
-o app \
main.go
FROM scratch
COPY --from=builder /build/app /root/app
ENTRYPOINT ["/root/app"]
EXPOSE 8080