slaventius 2 years ago
parent 994cce7f3a
commit 1b3832e94f
  1. 25
      deploy/Dockerfile

@ -0,0 +1,25 @@
FROM alpine/git AS downloader
ARG project_dir="/test3k_auth"
ARG project_name="test3k_auth"
ARG project_repo="http://git.slaventius.ru/test3k/auth.git"
WORKDIR /tmp${project_dir}
RUN git clone --depth=1 ${project_repo} /tmp${project_dir}
#
FROM golang:alpine AS builder
ARG project_dir="/test3k_auth"
ARG project_name="test3k_auth"
RUN apk add git
ENV GOPRIVATE=git.slaventius.ru/*
ENV GOINSECURE=git.slaventius.ru
WORKDIR /go/${project_dir}
COPY --from=downloader /tmp${project_dir} .
RUN go build -ldflags="-s -w" -o ./${project_name} ./cmd/main.go
#
FROM alpine
LABEL description "test3k_auth"
ARG project_dir="/test3k_auth"
ARG project_name="test3k_auth"
COPY --from=builder /go${project_dir}/${project_name} /bin/${project_name}
#
ENTRYPOINT [ "/bin/${project_name}" ]
#dckr_pat_ghyegOXFr3vViufK49FWOHtrRvQ
Loading…
Cancel
Save