From e8972497ca1d3448ccc1fc01e94cc60226c635e8 Mon Sep 17 00:00:00 2001 From: pityonline Date: Mon, 7 Dec 2020 17:45:29 +0800 Subject: [PATCH 1/3] fix missing directories --- conf/app.conf | 2 +- conf/pdfs/org_signature_pdf/.gitkeep | 0 conf/pdfs/output/.gitkeep | 0 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 conf/pdfs/org_signature_pdf/.gitkeep create mode 100644 conf/pdfs/output/.gitkeep diff --git a/conf/app.conf b/conf/app.conf index 41e4c58..ad29cea 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -15,7 +15,7 @@ api_token_expiry = 3600 api_token_key = fsfsfsafsfsasaf242342424sdfs;.]{77&&& pdf_org_signature_dir = ./conf/org_signature_pdf -pdf_out_dir = ./conf/pdf +pdf_out_dir = ./conf/pdfs code_platforms = ./conf/code_platforms.yaml email_platforms = ./conf/email.yaml diff --git a/conf/pdfs/org_signature_pdf/.gitkeep b/conf/pdfs/org_signature_pdf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/pdfs/output/.gitkeep b/conf/pdfs/output/.gitkeep new file mode 100644 index 0000000..e69de29 From 7d1379f1d28d1639802e2e20b475c286fa8d6640 Mon Sep 17 00:00:00 2001 From: pityonline Date: Tue, 26 Jan 2021 15:39:56 +0800 Subject: [PATCH 2/3] fix image building issues pass `--build-arg GOPROXY="xxx"` to use a proxy or mirror --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6443b0b..1b5daa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,15 @@ FROM golang:latest as BUILDER MAINTAINER TommyLike # build binary +ARG GOPROXY COPY . /go/src/github.com/opensourceways/app-cla-server RUN cd /go/src/github.com/opensourceways/app-cla-server && CGO_ENABLED=1 go build -v -o ./cla-server main.go # copy binary config and utils -FROM golang:latest -RUN apt-get update && apt-get install -y python3 && apt-get install -y python3-pip && pip3 install PyPDF2 && mkdir -p /opt/app/ +FROM python:latest +ARG GOPROXY +RUN if [ "$GOPROXY" != "" ]; then pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple; fi +RUN pip install PyPDF2 && mkdir -p /opt/app/ COPY ./conf /opt/app/conf COPY ./util/merge-signature.py /opt/app/util/merge-signature.py # overwrite config yaml From f566b95ba3be64cc6bbc29a7a77eb0ee599f5bc7 Mon Sep 17 00:00:00 2001 From: pityonline Date: Tue, 26 Jan 2021 16:30:45 +0800 Subject: [PATCH 3/3] simplify Dockerfile --- Dockerfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b5daa3..797a4d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,19 +4,20 @@ MAINTAINER TommyLike # build binary ARG GOPROXY -COPY . /go/src/github.com/opensourceways/app-cla-server -RUN cd /go/src/github.com/opensourceways/app-cla-server && CGO_ENABLED=1 go build -v -o ./cla-server main.go +WORKDIR /go/src/github.com/opensourceways/app-cla-server +COPY ./ . +RUN CGO_ENABLED=1 go build -v -o ./cla-server main.go # copy binary config and utils FROM python:latest ARG GOPROXY RUN if [ "$GOPROXY" != "" ]; then pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple; fi -RUN pip install PyPDF2 && mkdir -p /opt/app/ -COPY ./conf /opt/app/conf -COPY ./util/merge-signature.py /opt/app/util/merge-signature.py +RUN pip install PyPDF2 +WORKDIR /opt/app/ +COPY ./conf ./conf +COPY ./util/merge-signature.py ./util # overwrite config yaml -COPY ./deploy/app.conf /opt/app/conf -COPY --from=BUILDER /go/src/github.com/opensourceways/app-cla-server/cla-server /opt/app +COPY ./deploy/app.conf ./conf +COPY --from=BUILDER /go/src/github.com/opensourceways/app-cla-server/cla-server . -WORKDIR /opt/app/ ENTRYPOINT ["/opt/app/cla-server"]