Skip to content

Commit

Permalink
Merge pull request #1303 from Crown-Commercial-Service/update-aws-doc…
Browse files Browse the repository at this point in the history
…ker-file

Update Dockerfile.wsgi to match working DMP 1.5 version
  • Loading branch information
tim-s-ccs authored Jan 25, 2024
2 parents f59a7a5 + ac11e95 commit 000c3a1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docker-aws/Dockerfile.wsgi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 000c3a1

Please sign in to comment.