version: "3.8"
services:
  abiofore_app:
    container_name: abiofore_app
    build:
      context: .
      dockerfile: ./docker/php/Dockerfile
    expose:
      - 9000
    volumes:
      - .:/usr/src/app
      - ./public:/usr/src/app/public
    depends_on:
      - abiofore_db
    networks:
      - app_network

  abiofore_nginx:
    container_name: abiofore_nginx
    build:
      context: .
      dockerfile: ./docker/nginx/Dockerfile
    volumes:
    - ./public:/usr/src/app/public
    ports:
      - 8000:80
    depends_on:
      - abiofore_app
    environment:
      NGINX_FPM_HOST: abiofore_app
      NGINX_ROOT: /usr/src/app/public
    networks:
      - app_network

  abiofore_db:
    container_name: abiofore_db
    image: mysql:8.0.20
    restart: always
    volumes:
      - ./storage/db-data:/var/lib/mysql
    ports:
      - 3308:3308
    environment:
      MYSQL_DATABASE: abiofore
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: root
      MYSQL_PASSWORD: root
    networks:
      - app_network

  abiofore_redis:
    container_name: abiofore_redis
    image: redis:latest
    ports:
      - 6379:6379
    networks:
      - app_network

networks:
  app_network:
    driver: bridge
