version: "3.7"
services:
    app:
        build:
            args:
                user: sammy
                uid: 1000
            context: ./
            dockerfile: Dockerfile
        image: wms
        container_name: wms-app
        restart: unless-stopped
        working_dir: /var/www/
        volumes:
            - ./:/var/www
        networks:
            - wms

    db:
        image: mysql:8.0.30
        container_name: wms-db
        restart: unless-stopped
        environment:
            MYSQL_DATABASE: ${DB_DATABASE}
            MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
            MYSQL_PASSWORD: ${DB_PASSWORD}
            MYSQL_USER: ${DB_USERNAME}
            SERVICE_TAGS: dev
            SERVICE_NAME: mysql
        volumes:
            - ./docker-compose/mysql:/docker-entrypoint-initdb.d
        networks:
            - wms

    nginx:
        image: nginx:alpine
        container_name: wms-nginx
        restart: unless-stopped
        ports:
            - 80:80
            - 443:443
        volumes:
            - ./:/var/www
            - ./docker-compose/nginx/conf.d:/etc/nginx/conf.d/
            - ./docker-compose/nginx/certs:/etc/nginx/certs/
        networks:
            - wms

networks:
    wms:
        driver: bridge
