Docker Community Forums

Share and learn in the Docker community.

Though kinematic shows django is running on http://127.0.0.1:8000/ unable to access in web

i am trying to run django project on docker.

my dokcerfile:

FROM python:3.6.9-stretch
ENV http_proxy xx.xx.xx.xx:8080
ENV https_proxy xx.xx.xx.xx:8080
MAINTAINER xx xx xx
ENV PYTHONBUFFERED 1
RUN mkdir /myproject
WORKDIR /myproject
copy ./requirements.txt /myproject/
RUN pip install -r requirements.txt
COPY . /myproject/
CMD [“python”, “manage.py”, “migrate”]
CMD [“python”, “manage.py”, “runserver”, “8000”]

docker-compose.yml

version: ‘3’
services:
web:
build: .
volumes:
- .:/myproject
ports:
- “8000:8000”

In kiematic it shows django is running:

Watching for file changes with StatReloader
Performing system checks…
System check identified no issues (0 silenced).
You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate’ to apply them.
September 03, 2019 - 10:06:53
Django version 2.2.4, using settings ‘myproject.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

but when i acces in google chrome like http://127.0.0.1:8000/ it’s showing “This site can’t be reached” page.

may i know what is the problem.