Docker does not run my container

4

I am generating a container for my application with the following dockerfile

FROM django

ADD ./cryptoassistant /cryptoassistant

WORKDIR /cryptoassistant

RUN ["chmod", "+x", "/cryptoassistant/manage.py"]

RUN ["pip", "install", "--upgrade", "pip"]

RUN ["pip", "install", "-r", "requirements.txt"]

CMD [ "python", "./manage.py", "runserver"]

When I build the container and execute it, it shows this: It stays here, without doing anything else, the server does not seem upset because I can not access it.

I'm using windows.

Does anyone know why he does not execute the command?

Thank you.

    
asked by XBoss 21.08.2018 в 19:21
source

1 answer

2

The image of django in dockerhub is deprecated in favor of the standard image of python, and it has not been updated since December 31, 2016. It is possible that the version of your project is not compatible with the version displayed in this container. On the dockerhub page there is also an example of how a dockerfile could be made for a django project that uses python 3.4 and postgresql:

FROM python:3.4

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        postgresql-client \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .

EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

You can start from this example and adapt the python version to use and the database dependencies that are necessary.

    
answered by 19.10.2018 / 00:57
source