From ac11e9523e2cb5ac5d1833661a56b0f7926ad356 Mon Sep 17 00:00:00 2001 From: Tim South <58297459+tim-s-ccs@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:52:25 +0000 Subject: [PATCH] Update Dockerfile.wsgi to match working DMP 1.5 version --- docker-aws/Dockerfile.wsgi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-aws/Dockerfile.wsgi b/docker-aws/Dockerfile.wsgi index 5030b1910..1eb204d68 100644 --- a/docker-aws/Dockerfile.wsgi +++ b/docker-aws/Dockerfile.wsgi @@ -1,4 +1,4 @@ -# This does not inherit from a base build - The APT package requirements are so specific +# This does not inherit from a base build - The package requirements are so specific # to this one Python service that it would require its own individual base build and that # would only be used by one service - this one. So it's a fully bespoke build instead. # Python pinned as per original project @@ -12,9 +12,9 @@ WORKDIR ${APP_DIR} COPY requirements.txt ${APP_DIR} RUN python3 -m venv venv && \ echo ${release_name} > ${APP_DIR}/version_label && \ - apk upgrade && apk add build-base curl git libffi-dev \ + apk add build-base git libffi-dev \ xz pcre-dev libpq-dev libxml2-dev libxslt-dev \ - openssl-dev zlib-dev && rm -rf /var/cache/apk && \ + openssl-dev zlib-dev && \ /app/venv/bin/pip install --no-cache-dir --upgrade pip pyuwsgi==${DEP_PYUWSGI_VERSION} -r requirements.txt # Runtime stage @@ -24,13 +24,16 @@ ARG BUILD_DATE ARG BUILD_VERSION LABEL BUILD_DATE=${BUILD_DATE} LABEL BUILD_VERSION=${BUILD_VERSION} +RUN apk upgrade && apk add --no-cache curl libpq && rm -rf /var/cache/apk WORKDIR ${APP_DIR} COPY --from=base /app/venv /app/venv COPY --chown=uwsgi:uwsgi . ${APP_DIR} +ENV VIRTUAL_ENV=/app/venv +ENV PATH="$VIRTUAL_ENV/bin:$PATH" RUN addgroup -S uwsgi && adduser -S -H -G uwsgi uwsgi -CMD ["/app/venv/bin/uwsgi", "--http-socket", ":8888", "--master", "-w", "application:application"] +CMD ["uwsgi", "--http-socket", ":8888", "--master", "-w", "application:application"] EXPOSE 8888 USER uwsgi