I am trying to setup Docker and geodjagno. Upon docker-compose up
I have this following error:
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
GDAL is a library that can be found in this image wooyek/geodjango
Dockerfile
FROM wooyek/geodjango
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
docker-compose
services:
web:
build: .
container_name: web
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
db:
image: mdillon/postgis
#command: -e POSTGRES_USER=johndoe -e POSTGRES_PASSWORD=myfakedata -e POSTGRES_DB=myfakedata library/postgres
environment:
- POSTGRES_USER=johndoe
- POSTGRES_PASSWORD=myfakedata
- POSTGRES_DB=myfakedata
ports:
- "5435:5432"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
Try adding the following in your Dockerfile:
RUN apt-get update &&\
apt-get install -y binutils libproj-dev gdal-bin
You can add the following to your docker file
# Install GDAL dependencies
RUN apt-get install -y libgdal-dev g++ --no-install-recommends && \
apt-get clean -y
# Update C env vars so compiler can find gdal
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With