From 6ddeacf0368f561ecbb390913fae1d4963aa4893 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Sun, 11 Jul 2021 09:32:00 -0700 Subject: [PATCH 1/4] fix the scripts path in cic-eth --- apps/cic-eth/docker/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index 7e117c63..8d0028f2 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -36,12 +36,12 @@ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ ENTRYPOINT [] # --- RUNTIME --- -FROM python:3.8.6-slim-buster as runtime +FROM python:3.8.6-slim-buster as prod RUN apt-get update && \ apt install -y gnupg libpq-dev procps -WORKDIR /usr/src/cic-eth +WORKDIR /root COPY --from=dev /usr/local/bin/ /usr/local/bin/ COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ @@ -56,6 +56,7 @@ RUN chmod 755 *.sh COPY config/ /usr/local/etc/cic-eth/ COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ +COPY scripts/ . # TODO this kind of code sharing across projects should be discouraged...can we make util a library? #COPY util/liveness/health.sh /usr/local/bin/health.sh From 83503817549562fe7ec1de261d3270decd281043 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Sun, 11 Jul 2021 09:43:05 -0700 Subject: [PATCH 2/4] fix the scripts path in cic-eth --- apps/cic-eth/docker/Dockerfile | 4 ++-- apps/cic-eth/docker/Dockerfile_ci | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index 8d0028f2..f421aa0d 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -35,7 +35,7 @@ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ #COPY util/liveness/health.sh /usr/local/bin/health.sh ENTRYPOINT [] -# --- RUNTIME --- +# ------------------ PRODUCTION CONTAINER ---------------------- FROM python:3.8.6-slim-buster as prod RUN apt-get update && \ @@ -56,7 +56,7 @@ RUN chmod 755 *.sh COPY config/ /usr/local/etc/cic-eth/ COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ -COPY scripts/ . +COPY scripts/ scripts/ # TODO this kind of code sharing across projects should be discouraged...can we make util a library? #COPY util/liveness/health.sh /usr/local/bin/health.sh diff --git a/apps/cic-eth/docker/Dockerfile_ci b/apps/cic-eth/docker/Dockerfile_ci index cbdb7fb0..606752f5 100644 --- a/apps/cic-eth/docker/Dockerfile_ci +++ b/apps/cic-eth/docker/Dockerfile_ci @@ -33,13 +33,13 @@ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ #COPY util/liveness/health.sh /usr/local/bin/health.sh ENTRYPOINT [] -# --- RUNTIME --- -FROM python:3.8.6-slim-buster as runtime +# ------------------ PRODUCTION CONTAINER ---------------------- +FROM python:3.8.6-slim-buster as prod RUN apt-get update && \ apt install -y gnupg libpq-dev procps -WORKDIR /usr/src/cic-eth +WORKDIR /root COPY --from=dev /usr/local/bin/ /usr/local/bin/ COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ @@ -54,6 +54,7 @@ RUN chmod 755 *.sh COPY config/ /usr/local/etc/cic-eth/ COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ +COPY scripts/ scripts/ # TODO this kind of code sharing across projects should be discouraged...can we make util a library? #COPY util/liveness/health.sh /usr/local/bin/health.sh From 266bc3362da6f0a43550f68327671104639ba4b1 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Sun, 11 Jul 2021 09:51:08 -0700 Subject: [PATCH 3/4] just remove the cic-eth slim image for rn --- apps/cic-eth/docker/Dockerfile | 54 +++++++++++++++---------------- apps/cic-eth/docker/Dockerfile_ci | 54 +++++++++++++++---------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index f421aa0d..1af28dc0 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -35,31 +35,31 @@ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ #COPY util/liveness/health.sh /usr/local/bin/health.sh ENTRYPOINT [] -# ------------------ PRODUCTION CONTAINER ---------------------- -FROM python:3.8.6-slim-buster as prod - -RUN apt-get update && \ - apt install -y gnupg libpq-dev procps - -WORKDIR /root - -COPY --from=dev /usr/local/bin/ /usr/local/bin/ -COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ - /usr/local/lib/python3.8/site-packages/ - -COPY docker/entrypoints/* ./ -RUN chmod 755 *.sh - -# # ini files in config directory defines the configurable parameters for the application -# # they can all be overridden by environment variables -# # to generate a list of environment variables from configuration, use: confini-dump -z (executable provided by confini package) -COPY config/ /usr/local/etc/cic-eth/ -COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ -COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ -COPY scripts/ scripts/ - -# TODO this kind of code sharing across projects should be discouraged...can we make util a library? -#COPY util/liveness/health.sh /usr/local/bin/health.sh - -ENTRYPOINT [] +## ------------------ PRODUCTION CONTAINER ---------------------- +#FROM python:3.8.6-slim-buster as prod +# +#RUN apt-get update && \ +# apt install -y gnupg libpq-dev procps +# +#WORKDIR /root +# +#COPY --from=dev /usr/local/bin/ /usr/local/bin/ +#COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ +# /usr/local/lib/python3.8/site-packages/ +# +#COPY docker/entrypoints/* ./ +#RUN chmod 755 *.sh +# +## # ini files in config directory defines the configurable parameters for the application +## # they can all be overridden by environment variables +## # to generate a list of environment variables from configuration, use: confini-dump -z (executable provided by confini package) +#COPY config/ /usr/local/etc/cic-eth/ +#COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ +#COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ +#COPY scripts/ scripts/ +# +## TODO this kind of code sharing across projects should be discouraged...can we make util a library? +##COPY util/liveness/health.sh /usr/local/bin/health.sh +# +#ENTRYPOINT [] diff --git a/apps/cic-eth/docker/Dockerfile_ci b/apps/cic-eth/docker/Dockerfile_ci index 606752f5..27955b32 100644 --- a/apps/cic-eth/docker/Dockerfile_ci +++ b/apps/cic-eth/docker/Dockerfile_ci @@ -34,30 +34,30 @@ COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ ENTRYPOINT [] # ------------------ PRODUCTION CONTAINER ---------------------- -FROM python:3.8.6-slim-buster as prod - -RUN apt-get update && \ - apt install -y gnupg libpq-dev procps - -WORKDIR /root - -COPY --from=dev /usr/local/bin/ /usr/local/bin/ -COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ - /usr/local/lib/python3.8/site-packages/ - -COPY docker/entrypoints/* ./ -RUN chmod 755 *.sh - -# # ini files in config directory defines the configurable parameters for the application -# # they can all be overridden by environment variables -# # to generate a list of environment variables from configuration, use: confini-dump -z (executable provided by confini package) -COPY config/ /usr/local/etc/cic-eth/ -COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ -COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ -COPY scripts/ scripts/ - -# TODO this kind of code sharing across projects should be discouraged...can we make util a library? -#COPY util/liveness/health.sh /usr/local/bin/health.sh - -ENTRYPOINT [] - +#FROM python:3.8.6-slim-buster as prod +# +#RUN apt-get update && \ +# apt install -y gnupg libpq-dev procps +# +#WORKDIR /root +# +#COPY --from=dev /usr/local/bin/ /usr/local/bin/ +#COPY --from=dev /usr/local/lib/python3.8/site-packages/ \ +# /usr/local/lib/python3.8/site-packages/ +# +#COPY docker/entrypoints/* ./ +#RUN chmod 755 *.sh +# +## # ini files in config directory defines the configurable parameters for the application +## # they can all be overridden by environment variables +## # to generate a list of environment variables from configuration, use: confini-dump -z (executable provided by confini package) +#COPY config/ /usr/local/etc/cic-eth/ +#COPY cic_eth/db/migrations/ /usr/local/share/cic-eth/alembic/ +#COPY crypto_dev_signer_config/ /usr/local/etc/crypto-dev-signer/ +#COPY scripts/ scripts/ +# +## TODO this kind of code sharing across projects should be discouraged...can we make util a library? +##COPY util/liveness/health.sh /usr/local/bin/health.sh +# +#ENTRYPOINT [] +# From e599933ef8c5a812933aac3e1928255bc71ddd34 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Sun, 11 Jul 2021 10:08:04 -0700 Subject: [PATCH 4/4] fix requirements --- apps/cic-eth/docker/Dockerfile | 12 +++++++++--- apps/cic-eth/docker/Dockerfile_ci | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index 1af28dc0..2404c5e7 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -13,11 +13,17 @@ ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages # --force-reinstall \ # --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \ # -r requirements.txt - -COPY . . +COPY *requirements.txt . RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL . + --extra-index-url $GITLAB_PYTHON_REGISTRY \ + --extra-index-url $EXTRA_INDEX_URL \ + -r requirements.txt \ + -r services_requirements.txt \ + -r admin_requirements.txt + +COPY . . +RUN python setup.py install ENV PYTHONPATH . diff --git a/apps/cic-eth/docker/Dockerfile_ci b/apps/cic-eth/docker/Dockerfile_ci index 27955b32..89efdcc6 100644 --- a/apps/cic-eth/docker/Dockerfile_ci +++ b/apps/cic-eth/docker/Dockerfile_ci @@ -14,10 +14,16 @@ ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages # --force-reinstall \ # --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \ # -r requirements.txt - -COPY . . +COPY *requirements.txt . RUN pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL . + --extra-index-url $GITLAB_PYTHON_REGISTRY \ + --extra-index-url $EXTRA_INDEX_URL \ + -r requirements.txt \ + -r services_requirements.txt \ + -r admin_requirements.txt + +COPY . . +RUN python setup.py install COPY docker/entrypoints/* ./ RUN chmod 755 *.sh