uWSGI - chdir (): нет такого файла или каталога [core / uwsgi.c строка 2629] - PullRequest
0 голосов
/ 09 июня 2018

Я не могу запустить докеризованное приложение Django с помощью uWSGI.Ниже используется используемая конфигурация.

Dockerfile

FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN apt-get update
RUN apt-get install -y swig libssl-dev dpkg-dev netcat unixodbc-dev python-dev libldap2-dev libsasl2-dev
RUN mkdir /code
WORKDIR /code
COPY app/ /code/
RUN pip install -U pip
ENV PIP_TRUSTED_HOST="pypi.python.org pypi.org files.pythonhosted.org"
RUN apt-get install ca-certificates
RUN pip install -Ur requirements.txt
RUN chmod -R 777 /code
CMD ["/code/run.sh"]

run.sh

#!/bin/bash

./manage.py migrate
uwsgi --ini uwsgi.ini

app / uwsgi.ini

[uwsgi]
http-socket = :8000
chdir = /opt/code/
module = app.wsgi:application
master = 1
processes = 2
threads = 2

Ошибкапри запуске контейнера

Operations to perform:
  Apply all migrations: admin, api, auth, contenttypes, sessions
Running migrations:
  No migrations to apply.
[uWSGI] getting INI configuration from uwsgi.ini
*** Starting uWSGI 2.0.17 (64bit) on [Wed May 30 05:35:23 2018] ***
compiled with version: 6.3.0 20170516 on 30 May 2018 05:34:47
os: Linux-4.9.12-moby #1 SMP Tue Feb 28 12:11:36 UTC 2017
nodename: 0a9f49a479c7
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 6
current working directory: /code
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /opt/code/
chdir(): No such file or directory [core/uwsgi.c line 2629]

Может кто-нибудь помочь мне выяснить, в чем проблема с этой конфигурацией?

Ниже приведена структура проекта -

project
|--app
   |--app
   |--requirements.txt
   |--run.sh
   |--uwsgi.ini
   |--manage.py
|--Dockerfile
...