title: GeoDjango can't find gdal on docker python alpine based image
body: <p>I am creating a geodjango container (based on Python alpine official image) with gdal. When starting the container, I get the following error:</p>
  
  <pre><code>&gt;&gt;&gt; from django.contrib.gis import gdal
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/li...
  django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.3.0", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
  </code></pre>
  
  <p>my image contains following gdal libs:</p>
  
  <pre><code># find / -name libgdal*
  /usr/lib/libgdal.so.20
  /usr/lib/libgdal.so.20.5.0
  /usr/lib/libgdal.a
  /usr/lib/libgdal.so
  </code></pre>
  
  <p>Adding <code>GDAL_LIBRARY_PATH='usr/lib/libgdal.so.20'</code> to my django settings didn't solve this problem.</p>
  
  <p>My Dockerfile, based on official python3 alpine image.</p>
  
  <pre><code>FROM python:alpine
  
  ENV PYTHONUNBUFFERED 1
  ENV PYTHONDONTWRITEBYTECODE 1
  
  WORKDIR /usr/src/dbchiro
  
  COPY requirements.txt /usr/src/dbchiro
  
  # GeoDjango Dependencies
  
  RUN  echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" &gt; /etc/apk/repositories \
       &amp;&amp; echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" &gt;&gt; /etc/apk/repositories \
       &amp;&amp; echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" &gt;&gt; /etc/apk/repositories  \
       &amp;&amp; apk add --virtual .build-deps zlib-dev jpeg-dev gdal-dev musl-dev postgresql-dev\
        alpine-sdk libffi-dev jpeg-dev python-dev zlib-dev libffi gcc \ 
       &amp;&amp; apk add --no-cache postgresql-libs geos gdal postgresql-client libpq proj nginx \ 
       &amp;&amp; python3 -m pip install --upgrade pip --no-cache-dir \
       &amp;&amp; python3 -m pip install -r requirements.txt --no-cache-dir \
       &amp;&amp; python3 -m pip install gunicorn --no-cache-dir \
       &amp;&amp; apk --purge del .build-deps
  
  
  COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
  
  COPY . /usr/src/dbchiro
  
  VOLUME ["/app","/app/media"]
  
  WORKDIR /app
  
  EXPOSE 80
  
  ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
  
  CMD ["/bin/sh"]
  </code></pre>
  
  <p>docker-entrypoint</p>
  
  <pre class="lang-sh prettyprint-override"><code>#!/bin/sh
  
  export DBHOST=${DBHOST:-db}
  ...
  
  shopt -s dotglob nullglob
  mv /usr/src/dbchiro/* /app/
  
  ls /app
  
  cp -a /app/dbchiro/settings/configuration/config.py.sample /app/dbchiro/settings/configuration/config.py
  
  sed -i "s/dbHost/${DBHOST}/g" /app/dbchiro/settings/configuration/config.py
  ...
  
  until pg_isready -h $DBHOST -p $DBPORT
  do
    echo "Awaiting Database container"
    sleep 1
  done
  sleep 2
  
  cd /app
  
  export DJANGO_SETTINGS_MODULE=dbchiro.settings.$SETTINGS
  
  python -m manage makemigrations  accounts core blog dicts geodata management sights
  python -m manage migrate  
  python -m manage collectstatic --noinput 
  
  cp /app/static/img/logo_site.png.sample /app/static/img/logo_site.png
  
  #nginx Conf
  
  cp /app/dbchiro/settings/configuration/nginx_dbchiro.conf.sample /etc/nginx/conf.d/dbchiro.conf
  rm /etc/nginx/sites-enabled/*
  sed -i "s/pathToApp/app/g" /etc/nginx/conf.d/dbchiro.conf
  /etc/init.d/nginx restart
  
  gunicorn -b 127.0.0.1:8000 dbchiro.wsgi
  
  </code></pre>
  
  <p>requirements</p>
  
  <pre><code>arrow==0.15.2
  backports.csv==1.0.7
  colorlog==4.0.2
  defusedxml==0.6.0
  Django==2.2.5
  django-autocomplete-light==3.4.1
  django-ckeditor==5.7.1
  django-crispy-forms==1.7.2
  django-debug-toolbar==2.0
  django-extensions==2.2.1
  django-filter==2.2.0
  django-geojson==2.12.0
  django-js-asset==1.2.2
  django-leaflet==0.24.0
  django-nested-admin==3.2.4
  django-tables2==2.1.1
  et-xmlfile==1.0.1
  jdcal==1.4.1
  odfpy==1.4.0
  openpyxl==3.0.0
  Pillow==6.1.0
  psycopg2-binary==2.8.3
  python-dateutil==2.8.0
  python-monkey-business==1.0.0
  pytz==2019.2
  PyYAML==5.1.2
  six==1.12.0
  sqlparse==0.3.0
  tablib==0.13.0
  xlrd==1.2.0
  xlwt==1.3.0
  </code></pre>
  
  <p>Please some help, full project here
  <a href="https://framagit.org/fred.perso/dbchiroweb/tree/docker" rel="noreferrer">https://framagit.org/fred.perso/dbchiroweb/tree/docker</a></p>