diff --git a/.circleci/config.yml b/.circleci/config.yml index 08e1667bff..1b9167a8a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ jobs: - run: sudo apt-get update - run: sudo apt-get -y install libgeos-dev # Required for shapely - run: sudo apt-get -y install proj-bin libproj-dev - - run: pip install --upgrade pip pdm==2.7.4 + - run: pip install --upgrade pip pdm==2.18.1 - run: pdm export --dev --without-hashes > requirements.txt - run: pip install -r requirements.txt - run: mkdir --mode 766 -p /tmp/logs diff --git a/Dockerfile b/Dockerfile index 178c3444a5..4514086ec7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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.18.1 RUN pdm export --prod --without-hashes > requirements.txt @@ -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 \ @@ -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.5 EXPOSE 5678/tcp CMD ["python", "-m", "debugpy", "--wait-for-client", "--listen", "0.0.0.0:5678", \ "-m", "gunicorn", "-c", "python:backend.gunicorn", "manage:application", \ @@ -98,5 +97,7 @@ RUN python -c "import compileall; compileall.compile_path(maxlevels=10, quiet=1) RUN python -m compileall . EXPOSE 5000/tcp USER appuser:appuser +# Default gunicorn worker count is 1 +# For prod the WEB_CONCURRENCY env var can be used to set this CMD ["gunicorn", "-c", "python:backend.gunicorn", "manage:application", \ - "--workers", "1", "--log-level", "error"] + "--log-level", "error"] diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index f5bc32f280..c0760e765f 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -437,7 +437,7 @@ const Resources = { 'git clone --recursive https://github.com/hotosm/tasking-manager.git /opt/tasking-manager', 'cd /opt/tasking-manager/', cf.sub('git reset --hard ${GitSha}'), - 'pip install --upgrade pip pdm==2.7.4', + 'pip install --upgrade pip pdm==2.18.1', 'pdm export --prod > requirements.txt', 'wget -6 https://s3.dualstack.us-east-1.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz -O /tmp/aws-cfn-bootstrap-py3-latest.tar.gz', 'pip install /tmp/aws-cfn-bootstrap-py3-latest.tar.gz',