version: '2'
services:
    mysql:
        build: ./docker/mysql
        restart: unless-stopped
        container_name: mysql
        env_file:
            - ./docker/mysql/.env
        volumes:
            - ./docker/mysql/storage:/var/lib/mysql
            # - ./docker/mysql/conf.d:/etc/mysql/conf.d
            - ./docker/mysql/logs:/var/log/mysql
    redis:
        build: ./docker/redis
        restart: unless-stopped
        container_name: redis
        env_file:
            - ./docker/redis/.env
        volumes:
            - ./docker/redis/storage:/data
            - ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
    web:
        build: .
        depends_on:
            - mysql
            - redis
        container_name: web
        restart: unless-stopped
        env_file:
            - ./.env.staging
        ports:
            - 8888:80
        volumes:
            - .:/var/www
version: '2'
services:
    mysql:
        build: ./docker/mysql
        restart: unless-stopped
        container_name: mysql
        env_file:
            - ./docker/mysql/.env
        volumes:
            - ./docker/mysql/storage:/var/lib/mysql
            # - ./docker/mysql/conf.d:/etc/mysql/conf.d
            - ./docker/mysql/logs:/var/log/mysql
        networks: 
            - net
    redis:
        build: ./docker/redis
        restart: unless-stopped
        container_name: redis
        env_file:
            - ./docker/redis/.env
        volumes:
            - ./docker/redis/storage:/data
            - ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
        networks: 
            - net
    web:
        build: .
        depends_on:
            - mysql
            - redis
        container_name: web
        restart: unless-stopped
        env_file:
            - ./src/.env.staging
        ports:
            - 8888:80
        volumes:
            - ./src:/var/www
        networks: 
            - net

networks: 
    net:
        driver: "bridge"
Connect services with bridge network
Connect services with bridge network
