version: '3'
services:
  app:
    image: 'php:7.4-fpm'
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html
    networks:
      - laravel
  web:
    image: 'nginx:latest'
    ports:
      - '82:82'
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app
    networks:
      - laravel
  mysql:
    image: 'mysql:5.7'
    environment:
      MYSQL_DATABASE: laravel
      MYSQL_ROOT_PASSWORD: secret
    networks:
      - laravel
  redis:
    image: 'redis:latest'
    networks:
      - laravel
  worker:
    build:
      context: .
      dockerfile: Dockerfile.worker
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html
    networks:
      - laravel
networks:
  laravel: