services:
  app:
    build: .
    image: cryptoipg:latest
    restart: unless-stopped
    env_file: .env
    depends_on:
      - db
    ports:
      - "8080:80"
    volumes:
      - storage:/var/www/html/storage

  db:
    image: mysql:8.0
    restart: unless-stopped
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_DATABASE: ${DB_DATABASE:-cryptoipg}
      MYSQL_USER: ${DB_USERNAME:-cryptoipg}
      MYSQL_PASSWORD: ${DB_PASSWORD:-changeme}
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootchangeme}
    volumes:
      - dbdata:/var/lib/mysql

volumes:
  storage:
  dbdata:
