diff --git a/src/backend/Dockerfile b/src/backend/Dockerfile index f0c17c9397..a57be5a897 100644 --- a/src/backend/Dockerfile +++ b/src/backend/Dockerfile @@ -16,11 +16,11 @@ # ARG PYTHON_IMG_TAG=3.11 ARG MINIO_TAG=${MINIO_TAG:-RELEASE.2024-06-06T09-36-42Z} -FROM docker.io/minio/minio:${MINIO_TAG} as minio +FROM docker.io/minio/minio:${MINIO_TAG} AS minio # Includes all labels and timezone info to extend from -FROM docker.io/python:${PYTHON_IMG_TAG}-slim-bookworm as base +FROM docker.io/python:${PYTHON_IMG_TAG}-slim-bookworm AS base ARG APP_VERSION ARG COMMIT_REF ARG PYTHON_IMG_TAG @@ -39,13 +39,13 @@ RUN set -ex \ && update-ca-certificates # Set locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 # Extract dependencies from PDM lock to standard requirements.txt -FROM base as extract-deps +FROM base AS extract-deps WORKDIR /opt/python COPY pyproject.toml pdm.lock /opt/python/ RUN pip install --no-cache-dir --upgrade pip \ @@ -61,7 +61,7 @@ RUN pdm export --prod > requirements.txt \ # Build stage will all dependencies required to build Python wheels -FROM base as build +FROM base AS build # NOTE this argument is specified during production build on Github workflow # NOTE only the production API image contains the monitoring dependencies ARG MONITORING @@ -92,7 +92,7 @@ RUN pip install --user --no-warn-script-location --no-cache-dir \ # Run stage will minimal dependencies required to run Python libraries -FROM base as runtime +FROM base AS runtime ARG PYTHON_IMG_TAG ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ @@ -146,7 +146,7 @@ HEALTHCHECK --start-period=10s --interval=5s --retries=20 --timeout=5s \ # Add certificates to use ODK Central over SSL (HTTPS, required) -FROM runtime as add-odk-certs +FROM runtime AS add-odk-certs USER root # Add the SSL cert for debug odkcentral COPY --from=ghcr.io/hotosm/fmtm/proxy:debug \ @@ -155,7 +155,7 @@ RUN update-ca-certificates # Stage to use during local development -FROM add-odk-certs as debug +FROM add-odk-certs AS debug USER appuser COPY --from=extract-deps --chown=appuser \ /opt/python/requirements-debug.txt \ @@ -173,7 +173,7 @@ CMD ["python", "-Xfrozen_modules=off", "-m", "debugpy", \ # Used during CI workflows (as root), with docs/test dependencies pre-installed -FROM add-odk-certs as ci +FROM add-odk-certs AS ci ARG PYTHON_IMG_TAG COPY --from=extract-deps \ /opt/python/requirements-ci.txt /opt/python/ @@ -201,7 +201,7 @@ CMD ["sleep", "infinity"] # Final stage used during deployment -FROM runtime as prod +FROM runtime AS prod # Pre-compile packages to .pyc (init speed gains) RUN python -c "import compileall; compileall.compile_path(maxlevels=10, quiet=1)" # Note: 1 worker (process) per container, behind load balancer diff --git a/src/backend/pdm.lock b/src/backend/pdm.lock index 9c22ad74be..e04c26538c 100644 --- a/src/backend/pdm.lock +++ b/src/backend/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "debug", "dev", "docs", "monitoring", "test"] strategy = ["cross_platform"] lock_version = "4.5.0" -content_hash = "sha256:5a67da9d57a05b45616376bdb01ec9255959867a5f6de8469c3f334a3d0d011e" +content_hash = "sha256:0b251742ddfa49d9c69695eac81b46b2debdb020ef2992836851a2dfb0ad6be7" [[metadata.targets]] requires_python = ">=3.11" @@ -627,7 +627,7 @@ files = [ [[package]] name = "fmtm-splitter" -version = "1.3.1" +version = "1.3.2" requires_python = ">=3.10" summary = "A utility for splitting an AOI into multiple tasks." dependencies = [ @@ -638,8 +638,8 @@ dependencies = [ "shapely>=1.8.1", ] files = [ - {file = "fmtm-splitter-1.3.1.tar.gz", hash = "sha256:90b739df69c1ab8ad18d615423ef230665e0b43b94c3e6c1ce345f8e4021e18f"}, - {file = "fmtm_splitter-1.3.1-py3-none-any.whl", hash = "sha256:409795cbb6c2d261544e2dcf6314aabdd0b63c47af7996a26958356003b345fe"}, + {file = "fmtm-splitter-1.3.2.tar.gz", hash = "sha256:2112ef9a904ea33662047469036d314885a4ceeefaf3910507406a884710d4ab"}, + {file = "fmtm_splitter-1.3.2-py3-none-any.whl", hash = "sha256:2596ac3db423337d4bbc1244da7082d8e9c12ad22c6890a369fb78b12aa23786"}, ] [[package]] @@ -1639,7 +1639,7 @@ files = [ [[package]] name = "osm-fieldwork" -version = "0.16.8" +version = "0.16.9" requires_python = ">=3.10" summary = "Processing field data from ODK to OpenStreetMap format." dependencies = [ @@ -1665,8 +1665,8 @@ dependencies = [ "xmltodict>=0.13.0", ] files = [ - {file = "osm-fieldwork-0.16.8.tar.gz", hash = "sha256:7863f421643963f16a5c6c72a7989b172e142209bde001e6e12c4f89433ef6ff"}, - {file = "osm_fieldwork-0.16.8-py3-none-any.whl", hash = "sha256:7faa939efe477c92d847f73d725ffcca6fab7fd03fb07b838bd7c87821c846a4"}, + {file = "osm-fieldwork-0.16.9.tar.gz", hash = "sha256:113e2f2091eec54dea9ee29e1b14681bc881a2770591337773cd0ea1bdabd110"}, + {file = "osm_fieldwork-0.16.9-py3-none-any.whl", hash = "sha256:d38c1789a62abbe0e385e3750255d06fcbc22a885cbbdb69b4e29aee17519ff3"}, ] [[package]] @@ -1686,7 +1686,7 @@ files = [ [[package]] name = "osm-rawdata" -version = "0.3.2" +version = "0.3.3" requires_python = ">=3.10" summary = "Make data extracts from OSM data." dependencies = [ @@ -1702,8 +1702,8 @@ dependencies = [ "sqlalchemy>=2.0.0", ] files = [ - {file = "osm-rawdata-0.3.2.tar.gz", hash = "sha256:9e715c41ea0d7c306d984eee00859cb3414f5a705ed3578d43a5910e3d04a545"}, - {file = "osm_rawdata-0.3.2-py3-none-any.whl", hash = "sha256:97395ceb0ef9a5444a2cdf7cfcbcb95917bc35df4a395de0f30437d7b60e28b5"}, + {file = "osm-rawdata-0.3.3.tar.gz", hash = "sha256:9756174dc09ed026d2f14468d521f9c4d4f302054be6fa394c789a346b3e7525"}, + {file = "osm_rawdata-0.3.3-py3-none-any.whl", hash = "sha256:2c24381479a60ab6460e6606d25fba2c83ae379af1fec98bb460734eb36092f8"}, ] [[package]] diff --git a/src/backend/pyproject.toml b/src/backend/pyproject.toml index f3396ea2a6..819a845239 100644 --- a/src/backend/pyproject.toml +++ b/src/backend/pyproject.toml @@ -44,10 +44,10 @@ dependencies = [ "cryptography>=42.0.8", "pyjwt>=2.8.0", "async-lru>=2.0.4", - "osm-fieldwork==0.16.8", + "osm-fieldwork==0.16.9", "osm-login-python==2.0.0", - "osm-rawdata==0.3.2", - "fmtm-splitter==1.3.1", + "osm-rawdata==0.3.3", + "fmtm-splitter==1.3.2", ] requires-python = ">=3.11" readme = "../../README.md"