Я докерствую мои приложения django, вы знаете все, если вы используете поле изображения django, вам нужно использовать пакет Pillow
, но в настоящее время мой докер устанавливает весь пакет и выдает ошибку при попытке установить pillow
my Dockerfile
# pull official base image
FROM python:3.7-alpine
# set work directory
WORKDIR /app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBUG 0
# install psycopg2
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
&& pip install psycopg2 \
&& apk del build-deps
# install dependencies
COPY ./requirements.txt .
RUN pip install -r requirements.txt
# copy project
COPY . .
# collect static files
RUN python manage.py collectstatic --noinput
# add and run as non-root user
RUN adduser -D myuser
USER myuser
# run gunicorn
CMD gunicorn projectile.wsgi:application --bind 0.0.0.0:$PORT
и это requirements.txt
file
Django==2.2.2
Pillow==5.0.0
dj-database-url==0.5.0
gunicorn==19.9.0
whitenoise==4.1.2
psycopg2==2.8.4
Я не понимаю, что с ним не так, почему Pilow не устанавливается, выдает ошибку,это ниже:
The headers or library files could not be found for zlib,
remote: a required dependency when compiling Pillow from source.
remote:
remote: Please see the install instructions at:
remote: https://pillow.readthedocs.io/en/latest/installation.html
remote:
remote:
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k4_gcdwn/Pillow/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k4_gcdwn/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qgvai9fm/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Может кто-нибудь помочь мне исправить эту ошибку?
Спасибо