Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

349
Vistas
"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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda