Skip to content

Commit

Permalink
Merge pull request #6436 from hotosm/upgrade/backend-dockerfile
Browse files Browse the repository at this point in the history
Cleanup backend dockerfile
  • Loading branch information
dakotabenjamin authored Sep 3, 2024
2 parents df0cb76 + 74a705a commit 77b26c1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/docker/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM base as extract-deps
RUN pip install --no-cache-dir --upgrade pip
WORKDIR /opt/python
COPY pyproject.toml pdm.lock README.md /opt/python/
RUN pip install --no-cache-dir pdm==2.7.4
RUN pip install --no-cache-dir pdm==2.8.0
RUN pdm export --prod --without-hashes > requirements.txt


Expand All @@ -34,9 +34,8 @@ FROM base as build
RUN pip install --no-cache-dir --upgrade pip
WORKDIR /opt/python
# Setup backend build-time dependencies
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential
RUN apt-get install --no-install-recommends -y \
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
postgresql-server-dev-15 \
python3-dev \
libffi-dev \
Expand Down Expand Up @@ -79,7 +78,7 @@ COPY manage.py .

FROM runtime as debug
RUN pip install --user --no-warn-script-location \
--no-cache-dir debugpy==1.6.7
--no-cache-dir debugpy==1.8.1
CMD ["python", "-m", "debugpy", "--wait-for-client", "--listen", "0.0.0.0:5678", \
"-m", "gunicorn", "-c", "python:backend.gunicorn", "manage:application", \
"--reload", "--log-level", "error"]
Expand All @@ -93,4 +92,4 @@ RUN python -c "import compileall; compileall.compile_path(maxlevels=10, quiet=1)
RUN python -m compileall .
USER appuser:appuser
CMD ["gunicorn", "-c", "python:backend.gunicorn", "manage:application", \
"--workers", "1", "--log-level", "error"]
"--log-level", "error"]

0 comments on commit 77b26c1

Please sign in to comment.