version: '3.8'

services:
  bnpparibas:
    build: .
    ports:
      - "8080:80"
    environment:
      - DB_HOST=mysql
      - DB_DATABASE=bnpparibas
      - DB_USERNAME=bnp_user
      - DB_PASSWORD=secure_password
    volumes:
      - ./config.php:/var/www/bnpparibas/config.php
      - ./logs:/var/log/bnpparibas
      - ./database:/var/www/bnpparibas/database
    depends_on:
      - mysql
    restart: unless-stopped

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root_password
      MYSQL_DATABASE: bnpparibas
      MYSQL_USER: bnp_user
      MYSQL_PASSWORD: secure_password
    volumes:
      - mysql_data:/var/lib/mysql
      - ./docker/mysql-init.sql:/docker-entrypoint-initdb.d/init.sql
    ports:
      - "3306:3306"
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    restart: unless-stopped

volumes:
  mysql_data:
