services: mysql: image: mysql:latest environment: MYSQL_ROOT_PASSWORD: rootpassword MYSQL_DATABASE: laravel_db volumes: - mysql-data:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-prootpassword"] interval: 10s timeout: 5s retries: 10 restart: unless-stopped laravel: build: context: . dockerfile: Dockerfile depends_on: mysql: condition: service_healthy volumes: - ./laravel:/var/www/html environment: - DB_HOST=mysql - DB_PORT=3306 - DB_DATABASE=laravel_db - DB_USERNAME=root - DB_PASSWORD=rootpassword healthcheck: test: ["CMD", "pgrep", "php-fpm"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped nginx: image: nginx:latest depends_on: laravel: condition: service_healthy ports: - "80:80" # Changed from 8080 to 80 volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf - ./laravel:/var/www/html restart: unless-stopped volumes: mysql-data: