version: "3"
services:
  server:
    restart: unless-stopped
    image: ghcr.io/buku-masjid/buku-masjid:latest
    ports:
      - "8000:80"
    depends_on:
      - mysql
    environment:
      - DB_HOST=mysql_host
      - DB_PORT=3306
      - DB_DATABASE=homestead
      - DB_USERNAME=homestead
      - DB_PASSWORD=secret
    env_file:
      - .env
    networks:
      - web-dev

  mysql:
    hostname: mysql_host
    restart: unless-stopped
    platform: linux/x86_64
    image: "mysql:5.7"
    ports:
      - "3307:3306"
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: homestead
      MYSQL_USER: homestead
      MYSQL_PASSWORD: secret
    volumes:
      - database:/var/lib/mysql
    networks:
      - web-dev

networks:
  web-dev:

volumes:
  database:
