From f30945d3bb473b3ded9291f44ef1b342d6c58b81 Mon Sep 17 00:00:00 2001 From: Felipe Signorini Date: Tue, 31 Mar 2020 15:00:49 +0100 Subject: [PATCH] use a base gcc image --- Dockerfile | 12 +++--------- DockerfileCelery | 12 +++--------- docker-entrypoint-workers.sh | 4 ---- docker-entrypoint.sh | 4 ---- 4 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 docker-entrypoint-workers.sh delete mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 9237ae9..9e5ce72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,7 @@ -FROM python:3.8-slim AS compile +FROM maestroserver/maestro-python-gcc AS compile-graviz RUN apt-get -y update && \ apt-get -y install --no-install-recommends \ - curl \ - gcc \ - openssl \ - build-essential \ - libcurl4-openssl-dev \ - libssl-dev \ pkg-config \ graphviz-dev \ && rm -rf /var/lib/apt/lists/* @@ -19,7 +13,7 @@ RUN python3 -m venv /home/app/venv ENV PATH="/home/app/venv/bin:$PATH" COPY requirements.txt requirements.txt -RUN pip install --upgrade pip gunicorn && \ +RUN pip3 install --upgrade pip gunicorn && \ pip3 install --no-cache-dir -r requirements.txt @@ -27,7 +21,7 @@ RUN pip install --upgrade pip gunicorn && \ FROM python:3.8-slim RUN useradd --create-home app -COPY --from=compile /home/app/venv /home/app/venv +COPY --from=compile-graviz /home/app/venv /home/app/venv ENV PATH="/home/app/venv/bin:$PATH" diff --git a/DockerfileCelery b/DockerfileCelery index 0e0088f..dafef90 100644 --- a/DockerfileCelery +++ b/DockerfileCelery @@ -1,13 +1,7 @@ -FROM python:3.8-slim AS compile +FROM maestroserver/maestro-python-gcc AS compile-graviz RUN apt-get -y update && \ apt-get -y install --no-install-recommends \ - curl \ - gcc \ - openssl \ - build-essential \ - libcurl4-openssl-dev \ - libssl-dev \ pkg-config \ graphviz-dev \ && rm -rf /var/lib/apt/lists/* @@ -19,7 +13,7 @@ RUN python3 -m venv /home/app/venv ENV PATH="/home/app/venv/bin:$PATH" COPY requirements.txt requirements.txt -RUN pip install --upgrade pip && \ +RUN pip3 install --upgrade pip && \ pip3 install --no-cache-dir -r requirements.txt @@ -27,7 +21,7 @@ RUN pip install --upgrade pip && \ FROM python:3.8-slim RUN useradd --create-home app -COPY --from=compile /home/app/venv /home/app/venv +COPY --from=compile-graviz /home/app/venv /home/app/venv ENV PATH="/home/app/venv/bin:$PATH" diff --git a/docker-entrypoint-workers.sh b/docker-entrypoint-workers.sh deleted file mode 100644 index b35efdd..0000000 --- a/docker-entrypoint-workers.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -chown -R app:app . -su-exec app celery -A app.celery worker -l info \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100644 index 00d06ad..0000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -chown -R app:app . -su-exec app /usr/local/bin/gunicorn --config /opt/application/gunicorn_config.py run:app \ No newline at end of file