Docker Community Forums

Share and learn in the Docker community.

Docker-compose up is running but not showing in the browser

I am trying to build the image using the command:
docker-compose build
But I’m receiving the following error
Screenshots of my .yml and docker file is also attached.
Thanks in advance

My dockerfile:
FROM python:3
RUN mkdir /code
COPY requirements.txt /code/
COPY . /code/
RUN pip install -r requirements.txt

My docker-compose.yml:
version: ‘3’

build: .
command: python runserver
- “8888:8888”

f you already have one or more Dockerfiles, you can add Docker Compose files by opening the Command Palette (Ctrl+Shift+P), and using the Docker: Add Docker Compose Files to Workspace command. Follow the prompts.

You can add Docker Compose files to your workspace at the same time you add a Dockerfile by opening the Command Palette (Ctrl+Shift+P) and using the Docker: Add Docker Files to Workspace command. You’ll be asked if you want to add Docker Compose files. If you want to keep your existing Dockerfile, choose No when prompted to overwrite the Dockerfile.

The Docker extension adds the docker-compose.yml file to your workspace. This file contains the configuration to bring up the containers as expected in production. In some cases, a docker-compose.debug.yml is also generated. This file provides a simplified mode for starting that enables the debugger.

Screenshot of project with docker-compose files

The VS Code Docker extension generates files that work out of the box, but you can also customize them to optimize for your scenario. You can then use the Docker Compose Up command (right-click on the docker-compose.yml file, or find the command in the Command Palette) to get everything started at once. You can also use the docker-compose up command from the command prompt or terminal window in VS Code to start the containers. Refer to the Docker Compose documentation about how to configure the Docker Compose behavior and what command-line options are available.

With the docker-compose files, you can now specify port mappings in the docker-compose files, rather than in the .json configuration files. For examples, see the Docker Compose documentation.

@moderators @worldprog21 lewish95’s answer is shamelessly stolen from It is high likely not even related to your problem…