Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.4 kB
2
Indexable
Never
version: '3'

networks:
    blog-network:

services:

    # nginx
    nginx-service:
        image: nginx:stable-alpine
        container_name: nginx-container
        ports:
            - "8080:80"
        volumes:
            - ./app:/var/www/project
            - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
        depends_on:
            - php74-service
            - mysql8-service
        networks:
            - blog-network

    # php
    php74-service:
        build:
            context: .
            dockerfile: ./php/Dockerfile
        container_name: php74-container
        ports:
            - "9000:9000"
        volumes:
            - ./app:/var/www/project
        networks:
            - blog-network

    # adminer
    adminer-service:
        image: adminer
        restart: always
        environment:
            ADMINER_DEFAULT_SERVER: mysql8-service
        ports:
            - 8086:8080

    # mysql
    mysql8-service:
        image: mysql:8
        container_name: mysql8-container
        ports:
            - "4306:3306"
        volumes:
            - ./mysql:/var/lib/mysql
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 'pass'
        networks:
            - blog-network