#python #django #docker #docker-compose #synology
Вопрос:
Я пытаюсь запустить экземпляр контейнера docker (проект django) на моем nas synology DS220 . После:
docker-compose build
Я получаю эту ошибку:
traceback (most recent call last):
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
...
[6138] Failed to execute script docker-compose
Моя структура каталогов такова:
nas
|-docker
| |-configurator
| | |-accounts
| | |-config
| | |-pages
| | |-static
| | |-staticfiles
| | |-templates
| | |-docker-compose.yml
| | |-Dockerfile
| | |-manage.py
| | |-Pipfile
| | |-Pipfile.lock
| | |-requirements.txt
| |-some_other_project
Мой Док-файл:
FROM python:3.9
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /configurator/
COPY Pipfile Pipfile.lock /configurator/
COPY ./requirements.txt /requirements.txt
RUN pip install -r requirements.txt
COPY . /configurator/
Мой докер-compose.yml:
version: '3.8'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8080
volumes:
- .:/configurator/
ports:
- 8080:8080
depends_on:
- db
environment:
- "DJANGO_SECRET_KEY=django secret key"
- "DJANGO_DEBUG=True"
- "SENDGRID_API_KEY=my very secret api key"
db:
image: postgres:11
volumes:
- postgres_data:/configurator/data/postgresql/
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
volumes:
postgres_data:
Я в замешательстве из-за ошибки разрешения. Есть идеи? Спасибо!
Комментарии:
1. Ваш файл dockerfile, возможно, вам сначала потребуется установить pip