version: '3'

services:
    mysql:
        image: mysql:5.7
        command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --init-connect='SET NAMES utf8mb4;' --innodb-flush-log-at-trx-commit=0 --innodb-use-native-aio=0
        volumes:
            - ./mysqldata:/var/lib/mysql
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 654321
            MYSQL_DATABASE: h4h
            MYSQL_USER: h4h
            MYSQL_PASSWORD: 123456
        ports:
            - "${MYSQL_PORT}:3306"
        container_name: h4h-mysql

    webserver:
        build:
            context: .
            dockerfile: Dockerfile
        privileged: true
        restart: always
        depends_on:
            - mysql
        ports:
            - "${WEB_HTTP_PORT}:80"
            - "${WEB_HTTPS_PORT}:443"
        volumes:
            - ../www:/var/www/h4h
        container_name: h4h-webserver