Skip to content

Commit

Permalink
Update MapProxy to 1.16.0, Python to 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ropable committed Oct 3, 2023
1 parent f13a927 commit 2f9068a
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 414 deletions.
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.15-slim-buster as builder_base
FROM python:3.10.13-slim-bullseye as builder_base_mapproxy
MAINTAINER [email protected]
LABEL org.opencontainers.image.source https://github.com/dbca-wa/mapproxy

Expand All @@ -11,19 +11,25 @@ RUN apt-get update -y \
&& pip install --upgrade pip

# Install Python libs using Poetry.
FROM builder_base as python_libs_mapproxy
FROM builder_base_mapproxy as python_libs_mapproxy
WORKDIR /app
ENV POETRY_VERSION=1.2.2
RUN pip install "poetry==$POETRY_VERSION"
ENV POETRY_VERSION=1.5.1
RUN pip install --upgrade pip && pip install "poetry==$POETRY_VERSION"
COPY poetry.lock pyproject.toml /app/
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --only main
&& poetry install --no-interaction --no-ansi --without dev

# Create a non-root user.
ARG UID=10001
ARG GID=10001
RUN groupadd -g "${GID}" appuser \
&& useradd --no-create-home --no-log-init --uid "${UID}" --gid "${GID}" appuser

# Install the project.
FROM python_libs_mapproxy
COPY gunicorn.py wsgi.py ./
RUN ln -s /app/config/mapproxy.yaml /app/mapproxy.yaml
USER www-data

USER ${UID}
EXPOSE 8080
HEALTHCHECK --interval=1m --timeout=5s --start-period=10s --retries=3 CMD ["wget", "-q", "-O", "-", "http://localhost:8080/demo/"]
CMD ["gunicorn", "--config", "gunicorn.py", "wsgi"]
Loading

0 comments on commit 2f9068a

Please sign in to comment.