diff --git a/Dockerfile b/Dockerfile index 0041ab3..cde3cf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,7 @@ ENV GONOSUMDB=gitlab.connectone.pro/* WORKDIR /opt/app RUN apk add --no-cache tzdata ca-certificates git openssh COPY --from=build /build/gomodproxy ./ +ADD entrypoint.sh . +RUN chmod a+x *.sh +ENTRYPOINT ["/opt/app/entrypoint.sh"] CMD ["/opt/app/gomodproxy", "--addr", ":8080"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index fbd62e9..c8afe2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,9 @@ services: target: /root/.ssh bind: propagation: shared + environment: + GIT_USER: "" + GIT_PASS: "" command: - /opt/app/gomodproxy - --dir @@ -26,4 +29,4 @@ services: - -git - gitlab.connectone.pro/:/root/.ssh/id_rsa - -git - - gitlab.connectone.pro/:goproxy:glpat-_4p1YmfjcMsxdfXnayLm \ No newline at end of file + - gitlab.connectone.pro/:${GIT_USER}:${GIT_PASS} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..3f9f210 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh +git config --global url."https://${GIT_USER}:${GIT_PASS}@gitlab.connectone.pro".insteadOf "https://gitlab.connectone.pro" \ No newline at end of file