version: '3.8'

services:
  athenahr_app:
    image: athenahr:1.1.1
    container_name: athenahr_app
    volumes:
      - ./:/var/www/html
    ports:
      - ":9000"
    networks:
      - athenahrdev_network
    depends_on:
      - mariadb
    environment:
      - DB_HOST=mariadb
      - DB_DATABASE=athenahr
      - DB_USERNAME=athenahr
      - DB_PASSWORD=athenahr_db_pw
    env_file:
      - .env

  mariadb:
    image: mariadb:latest
    container_name: athenahr_mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    environment:
      - MYSQL_DATABASE=athenahr
      - MYSQL_USER=athenahr
      - MYSQL_PASSWORD=athenahr_db_pw
      - MYSQL_ROOT_PASSWORD=athenahr_db_pw
    volumes:
      - mariadb_data:/var/lib/mysql
    networks:
      - athenahrdev_network

  nginx:
    image: nginx:latest
    container_name: athenahr_nginx
    volumes:
      - ./:/var/www/html
      - ./docker/nginx:/etc/nginx/conf.d
    ports:
      - "8989:80"
    networks:
      - athenahrdev_network
    depends_on:
      - athenahr_app


networks:
  athenahrdev_network:

volumes:
  mariadb_data:
