Skip to content

Commit

Permalink
[TM-1467] add new requeriments for python
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 committed Dec 19, 2024
1 parent fadc5ef commit 51a3973
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
39 changes: 19 additions & 20 deletions docker/php.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM php:8.2-apache AS php

RUN apt-get update
RUN apt-get install -y \
# Add backports for more recent GDAL version
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list

RUN apt-get update && apt-get install -y \
libxml2-dev \
libonig-dev \
libpng-dev \
Expand All @@ -24,16 +26,9 @@ RUN apt-get install -y \
g++ \
python3-gdal \
proj-data \
proj-bin

# Add GDAL specific environment variables
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal
ENV GDAL_VERSION=3.4.1

# Set GDAL configuration
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal
RUN export C_INCLUDE_PATH=/usr/include/gdal
proj-bin \
libgdal28 \
python3-gdal

# PHP Extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
Expand Down Expand Up @@ -70,14 +65,18 @@ ENV PATH="/opt/python/bin:${PATH}"
RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir numpy wheel setuptools

# Install GDAL and its dependencies
RUN apt-get install -y python3-gdal
RUN gdal-config --version
ENV GDAL_CONFIG=/usr/bin/gdal-config
RUN pip3 install --no-binary :all: GDAL==${GDAL_VERSION}

# Install remaining requirements
RUN pip3 install -r /root/voronoi-requirements.txt
# Install remaining requirements EXCEPT GDAL (since we're using system GDAL)
RUN pip3 install pyproj==3.4.1 \
shapely==2.0.1 \
geopandas==1.0.1 \
pandas==2.1.3 \
requests==2.32.3 \
fiona==1.10.1 \
exactextract==0.2.0 \
rasterio==1.4.1 \
pyyaml==6.0.2 \
rasterstats==0.20.0 \
boto3==1.35.43

RUN chmod -R a+rx /opt/python
USER www-data
Expand Down
1 change: 0 additions & 1 deletion resources/python/polygon-voronoi/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ requests==2.32.3
fiona==1.10.1
exactextract==0.2.0
rasterio==1.4.1
gdal==3.4.1
pyyaml==6.0.2
rasterstats==0.20.0
boto3==1.35.43

0 comments on commit 51a3973

Please sign in to comment.