1
0
mirror of https://github.com/umputun/reproxy.git synced 2024-11-24 08:12:31 +02:00
reproxy/Dockerfile

29 lines
623 B
Docker
Raw Normal View History

2021-04-04 05:26:53 +02:00
FROM umputun/baseimage:buildgo-latest as backend
ARG GIT_BRANCH
ARG GITHUB_SHA
ARG CI
ENV GOFLAGS="-mod=vendor"
ADD . /build
WORKDIR /build
RUN \
if [ -z "$CI" ] ; then \
echo "runs outside of CI" && version=$(/script/git-rev.sh); \
else version=${GIT_BRANCH}-${GITHUB_SHA:0:7}-$(date +%Y%m%dT%H:%M:%S); fi && \
echo "version=$version" && \
cd app && go build -o /build/reproxy -ldflags "-X main.revision=${version} -s -w"
FROM umputun/baseimage:app-latest
COPY --from=backend /build/reproxy /srv/reproxy
RUN chmod +x /srv/reproxy
WORKDIR /srv
CMD ["/srv/reproxy"]
2021-04-09 05:06:44 +02:00
ENTRYPOINT ["/init-root.sh"]