Docker Laravel Nginx, storage goes to 404 page

Viewed 876

I'm facing an issue when opening files uploaded from my web app build with Laravel 7. The files are well stored in my app. I've also tried to run the project locally without using docker and everything is working fine, I can check the files without any issue.

In docker, I have three containers ( app, web , db ) I've created the symlink using php artisan storage:link My static assets are accessible.

Here is my docker-compose.yml

version: '2'

services:

  #  The Application
  app:
    container_name: app
    build:
      context: ./
      dockerfile: development/app.dockerfile
    volumes:
      - ./:/var/www
    env_file: '.env.dev'
    environment:
      - "DB_HOST=database"

  # The Web Server
  web:
    container_name: web
    build:
      context: ./
      dockerfile: development/web.dockerfile
    volumes:
      - ./storage/logs/:/var/log/nginx
    ports:
      - 8990:80

  # The Database
  database:
    container_name: db
    image: mariadb:10.4
    volumes:
      - dbdata:/var/lib/mysql
    environment:
      - "MYSQL_DATABASE=database"
      - "MYSQL_USER=...
      - "MYSQL_PASSWORD=...
    ports:
      - 8991:3306

Grateful if someone could help me with this issue.

1 Answers
Related