无法在Docker中启动Django

时间:2017-05-15 06:01:19

标签: django docker

我正在尝试在Docker中运行Django-packages,但我无法。

我得到以下内容: -

django_1    | Postgres is up - continuing...
django_1    | python: can't open file 'manage.py': [Errno 2] No such file or directory
django_1    | python: can't open file 'manage.py': [Errno 2] No such file or directory

一切似乎都很好。守护进程正在运行。

docker ps

C:\djangopackages-master>docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

docker volume ls

C:\djangopackages-master>docker volume ls
DRIVER              VOLUME NAME
local               djangopackagesmaster_postgres_backup_dev
local               djangopackagesmaster_postgres_data_dev
local               ef5505952d82c1472e74e21a8d2921018b2f7ee5570742268c8560335fe5762b

似乎无法弄清楚可能是什么问题。

我如何构建泊坞窗容器: 克隆以下repo后, docker-compose -f dev.yml up https://github.com/djangopackages/djangopackages

用于创建的Docker文件: -

https://github.com/djangopackages/djangopackages/blob/master/compose/caddy/Dockerfile

https://github.com/djangopackages/djangopackages/blob/master/compose/django/Dockerfile

https://github.com/djangopackages/djangopackages/blob/master/compose/django/Dockerfile-dev

https://github.com/djangopackages/djangopackages/blob/master/compose/postgres/Dockerfile

https://github.com/djangopackages/djangopackages/blob/master/compose/redis/Dockerfile

在此特定的dockerfile中

FROM python:3.6

ENV PYTHONUNBUFFERED 1

# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements.txt /requirements.txt

COPY ./manage.py /manage.py

RUN pip install -r /requirements.txt

COPY ./compose/django/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r//' /entrypoint.sh
RUN chmod +x /entrypoint.sh

COPY ./compose/django/start-dev.sh /start-dev.sh
RUN sed -i 's/\r//' /start-dev.sh
RUN chmod +x /start-dev.sh


WORKDIR /app

ENTRYPOINT ["/entrypoint.sh"]

如果我告诉复制manage.py,那么manage.py运行(当然有错误)。它似乎没有在正确的路径中运行manage.py.不知道该怎么做了。

0 个答案:

没有答案