From 18434cfca10c7a2ca01df96af483ab1e7d216b51 Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Sat, 16 May 2026 18:17:58 +0200 Subject: [PATCH] restructure Dockerfile, make it a bit smaller --- .dockerignore | 10 ++++++++++ Dockerfile | 22 ++++++++-------------- requirements.txt | 3 +++ 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .dockerignore create mode 100644 requirements.txt diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e53c6ed --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +__pycache__/ +*.py[cod] +*.pyo +*.pyd +*.swp +*.tmp +*.bak +.git +.gitignore +.DS_Store diff --git a/Dockerfile b/Dockerfile index 3411f6c..02d26ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,16 @@ FROM python:3.11-slim -RUN apt-get update && apt-get install -y --no-install-recommends \ - libexpat1 \ - && rm -rf /var/lib/apt/lists/* +ENV PYTHONUNBUFFERED=1 \ + THREEDTREES_METADATA_REFERENCE_DIR=/reference-data -RUN mkdir -p /in /out /src /reference-data && chmod 777 /in /out /src /reference-data - -RUN pip install --no-cache-dir \ - fiona \ - pyproj \ - shapely +WORKDIR /src +COPY requirements.txt ./ COPY src/ /src/ COPY reference-data/ /reference-data/ -RUN chmod -R a+rX /src -RUN chmod -R a+rX /reference-data -ENV THREEDTREES_METADATA_REFERENCE_DIR=/reference-data +RUN pip install --no-cache-dir -r requirements.txt && \ + chmod -R a+rX /src /reference-data -WORKDIR /src -CMD ["python", "run.py", "--help"] +ENTRYPOINT ["python", "run.py"] +CMD ["--help"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b05518e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +fiona==1.10.1 +pyproj==3.7.2 +shapely==2.1.2