Docker Community Forums

Share and learn in the Docker community.

404 not found in browser trying to access web project

I'm getting 404 not found in browser trying to access a web project. My setup is as follows

Containers

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0db35f599b4b nginx "/docker-entrypoint.…" 11 hours ago Up About a minute 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nginx-webserver b54ab6cffd85 digitalocean.com/php "docker-php-entrypoi…" 2 days ago Up About a minute 9000/tcp digital_ocean_app cf44107d2cca mysql:5.7.22 "docker-entrypoint.s…" 2 days ago Up About a minute 0.0.0.0:3306->3306/tcp mysql_db

Docker Compose

version: '3' services:

#PHP Service
app:
build:
context: .
dockerfile: Dockerfile
image: digitalocean.com/php
container_name: digital_ocean_app
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: app
SERVICE_TAGS: dev
working_dir: /var/www
networks:
- app-network

#Nginx Service
webserver:
image: nginx
container_name: nginx-webserver
restart: unless-stopped
tty: true
extra_hosts:
- “my-laravel-social:127.0.0.1”
ports:
- “80:80”
- “443:443”
volumes:
- ./public:/var/www
- ./nginx/conf.d/:/etc/nginx/conf.d/
networks:
- app-network

#MySQL Service
db:
image: mysql:5.7.22
container_name: mysql_db
restart: unless-stopped
tty: true
ports:
- “3306:3306”
environment:
MYSQL_DATABASE: my-laravel-social
MYSQL_ROOT_PASSWORD: trantystrobe
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql
- ./mysql/my.cnf:/etc/mysql/my.cnf
networks:
- app-network

#Docker Networks
networks:
app-network:
driver: bridge

#Volumes
volumes:
dbdata:
driver: local

As mentioned, a 404 Not Found Error indicates that the client (web browser) is receiving a message from the server (remote computer) that the specific resource (web page/URL) is unavailable. … Alternatively, some web applications “fake” 404 Not Found Errors when an invalid resource is requested.