ERR_EMPTY_RESPONSE - Docker-Compose - Windows -Django

I just recently moved to windows 10 from linux and am now trying to run a dockerized django web-application but with no success. I am working with docker-compose and when I run docker-compose up, I can see the container running but the browser shows the following message:

This page isn’t working
127.0.0.1 didn’t send any data.
ERR_EMPTY_RESPONSE

I receive the same response when using 0.0.0.0

This is my Dockerfile:

# pull the official base image
FROM python:3

RUN mkdir /app

# set work directory
WORKDIR /app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install dependencies
COPY ./requirements.txt /app
RUN pip install -r requirements.txt
# add project
ADD . /app
 

and this is my docker-compose.yml

version: "3"

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 8000:8000
    volumes:
      - .:\app
    command: python manage.py runserver 

This is a windows specific issues it appears as when I run it on my linux machine, everything works fine.

Previous questions on the topic indicated that it's a port mapping issue in Windows (e.g., https://stackoverflow.com/a/65721397/6713085)

However, I have not been able to solve it. Do you have any suggestions?

Thanks in advance for any help.

Back to Top