Reputation: 1755
I am using Ubuntu and tried to run Django with Docker.
When I give docker-compose up
command it give below output
Starting aug6_web_1 ... done
Attaching to aug6_web_1
web_1 | Watching for file changes with StatReloader
and does not print anything else ... for almost 20 min now.
Here is my docker-compose.yml
:
version: '3'
services:
web:
build:
context: ./
command: python manage.py runserver 127.0.0.0:8000
volumes:
- .:/AUG6
ports:
- '8000:8000'
And my Dockerfile
:
FROM python:3
ENV PYTHONBUFFERED 1
RUN mkdir /AUG6
WORKDIR /AUG6
COPY /requirements.txt /AUG6/
RUN pip install -r requirements.txt
COPY . /AUG6/
Very first day of learning Docker, excuse if any mistakes
Upvotes: 0
Views: 2168
Reputation: 4574
docker-compose up
will not terminate as long as the containers are running.
If you want it to start the containers and then terminate, use docker-compose up -d
.
Check the docker-compose manual.
EDIT 1:
I just spotted a mistake in your runserver
command:
You have python manage.py runserver 127.0.0.0:8000
but it should be python manage.py runserver 127.0.0.1:8000
.
You can remove the IP:PORT completely, as you use the defaults. Check the docs.
Upvotes: 3