services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: scoa-app
    restart: unless-stopped
    working_dir: /var/www/html
    volumes:
      - ./:/var/www/html
    networks:
      - scoa-network
    command: php-fpm
    depends_on:
      - mysql
  nginx:
    image: nginx:alpine
    container_name: scoa-nginx
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - ./:/var/www/html
      - ./docker/nginx/app.conf:/etc/nginx/conf.d/default.conf
    networks:
      - scoa-network
    depends_on:
      - app

  redis:
    image: redis:alpine
    container_name: scoa-redis
    restart: unless-stopped
    ports:
      - "6379:6379"
    networks:
      - scoa-network

  mysql:
    image: mysql:8.0
    container_name: scoa-mysql
    restart: unless-stopped
    ports:
      - "33060:3306"
    environment:
      MYSQL_ROOT_PASSWORD: 'root'
      MYSQL_DATABASE: 'ALLINK_SERVICE'
      MYSQL_USER: 'scoa'
      MYSQL_PASSWORD: 'root'
    volumes:
      - ./docker/mysql/data:/var/lib/mysql
    networks:
      - scoa-network

networks:
  scoa-network:
    driver: bridge
