version: "3"

services:
    database:
        image: mysql:5.7
        ports:
            - 3306:3306
        restart: always
        environment:
            - MYSQL_ROOT_PASSWORD=root
            - MYSQL_DATABASE=servicefacilitators
            - MYSQL_USER=servicefacilitators
            - MYSQL_PASSWORD=servicefacilitators
        volumes:
            - ./mysql-initdb.d:/docker-entrypoint-initdb.d
            
    app:
        build:
            args:
                user: climatext
                uid: 1000
            context: ./
            dockerfile: Dockerfile
        restart: unless-stopped
        working_dir: /var/www/
        volumes:
            - ./:/var/www

    nginx:
        image: nginx:alpine
        restart: unless-stopped
        ports:
            - 8080:80
        volumes:
            - ./:/var/www
            - ./docker-compose/nginx:/etc/nginx/conf.d/
