mirror of
https://github.com/umputun/reproxy.git
synced 2024-11-23 09:27:22 +03:00
add Dockerfile
This commit is contained in:
parent
bde03724e5
commit
d4c66e4483
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
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"]
|
||||
ENTRYPOINT ["/init.sh"]
|
Loading…
Reference in New Issue
Block a user