Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
"The connection was reset" in localhost:8000 using django and docker

After running docker-compose up,

Starting docker_django ... done

Attaching to docker_django

docker_django | Watching for file changes with StatReloader

docker_django | Performing system checks...

docker_django | System check identified no issues (0 silenced).

docker_django | February 12, 2020 - 07:26:35

docker_django | Django version 3.0.3, using settings 'backend.settings'

docker_django | Starting development server at http://127.0.0.1:8000/

docker_django | Quit the server with CONTROL-C.

when i connect to http://127.0.0.1:8000/ it shows this enter image description here There is no problem / error running the docker-compose command but only when visiting the site.

Im using ubuntu 19.10 and the project has django v3.

Dockerfile

FROM python:3

ENV PYTHONUNBUFFERED 1

RUN mkdir /code
WORKDIR /code

COPY . /code/

RUN pip install -r requirements.txt

docker-compose.yml

version: '3'

services:
    web:
        build: .
        container_name: docker_django
        command: python manage.py runserver
        volumes:
            - .:/code
        ports:
            - "8000:8000"
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Your application only listens to requests coming from localhost, which in case of a container are requests coming from inside the container.

Try this compose file:

version: '3'

services:
    web:
        build: .
        container_name: docker_django
        command: python manage.py runserver 0.0.0.0:8000
        volumes:
            - .:/code
        ports:
            - "8000:8000"

corrected typo for port number as suggested

over 4 years ago · Santiago Trujillo Report

0

What ended up working for me was:

  1. Stopping all docker instance
  2. Opening a command prompt in admin mode
  3. Executing the command 'netsh winsock reset'
  4. Restarting the machine
  5. Restarting docker containers
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!