build files
Some checks failed
/ Make image (push) Failing after 23s

This commit is contained in:
nquidox 2026-04-05 20:16:44 +03:00
parent 2a3ba0e797
commit a5aec1fca3
2 changed files with 33 additions and 0 deletions

31
Dockerfile Normal file
View file

@ -0,0 +1,31 @@
FROM golang:1.26.1-alpine3.23 AS builder
RUN apk add --no-cache git
ENV GOPRIVATE=repo.nqws.ru/*
ENV GONOSUMDB=repo.nqws.ru/*
WORKDIR /app
COPY go.mod go.sum ./
RUN --mount=type=secret,id=netrc,dst=/root/.netrc,mode=0600 \
git config --global credential.helper 'store --file=/root/.netrc' && \
go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o main "./cmd"
FROM alpine:3.23
RUN apk add --no-cache \
tzdata \
ca-certificates
COPY --from=builder /app/main /usr/local/bin/app
RUN chmod +x /usr/local/bin/app
ENTRYPOINT ["app"]