Я пытаюсь развернуть приложение Django в гибкой среде App Engine. Мой dockerfile не может установить GDAL.
Это сообщение об ошибке, которое я получаю при запуске gcloud app deploy
:
File "/env/lib/python3.7/site-packages/django/contrib/gis/gdal/libgdal.py", line 42, in <module>
% '", "'.join(lib_names)
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.4.0", "gdal2.3.0", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
[2020-04-24 16:12:26 +0000] [8] [INFO] Worker exiting (pid: 8)
[2020-04-24 16:12:26 +0000] [1] [INFO] Shutting down: Master
[2020-04-24 16:12:26 +0000] [1] [INFO] Reason: Worker failed to boot.
Это мой dockerfile:
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y \
binutils \
gdal-bin \
python3-gdal \
ibgdal-dev \
libproj-dev
# Create a virtualenv for dependencies. This isolates these packages from
# system-level packages.
# Use -p python3 or -p python3.7 to select python version. Default is version 2.
RUN virtualenv /env -p python3.7
# Setting these environment variables are the same as running
# source /env/bin/activate.
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
# Copy the application's requirements.txt and run pip to install all
# dependencies into the virtualenv.
RUN pip install -r requirements.txt
# Add the application source code.
ADD . /
# Run a WSGI server to serve the application. gunicorn must be declared as
# a dependency in requirements.txt.
CMD gunicorn -b :$PORT main:app
, и это мой app.yaml :
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
# You can also specify 2 for Python 2.7
python_version: 3.7
Мне известно, что я задаю очень похожий вопрос, на который отвечаю здесь , но собственное решение спрашивающих, похоже, не работает.