version: "3.7"
services:
    app:
        build:
        #   args:
            # user: sammy
            # uid: 1000
          context: ./
          dockerfile: Dockerfile
        container_name: PHP
        depends_on:
            - db
        volumes:
            - ./:/var/www
        networks:
            - se_camp
    db:
        image: mariadb:latest
        container_name: se_camp_db
        environment:
            MARIADB_ROOT_PASSWORD: r0Otp@ssw0rd # r 0 ศูนย์ O โอใหญ่
            MARIADB_ROOT_HOST: '%'
            MARIADB_ALLOW_EMPTY_PASSWORD: false
            MARIADB_DATABASE: mycamp_db
            MARIADB_USER: se_camp
            MARIADB_PASSWORD: p@ssw0rd
        volumes:
            - ./temp_database:/var/lib/mysql
        networks:
            - se_camp
        ports:
          - 3306:3306
    nginx:
        image: nginx:alpine
        container_name: se_camp_web_server
        restart: unless-stopped
        ports:
            - "8080:80"
        volumes:
            - ./:/var/www
            - ./nginx_se_camp.conf:/etc/nginx/conf.d/default.conf
        networks:
            - se_camp

networks:
    se_camp:
        driver: bridge
