docker-compose写法收集

version: '3.3'

services:
    php:
        image: docker.ksyun.com/php7.2.3-fpm-alpine3.7:latest
        volumes:
            - ./env/log/apps:/data/log/apps
            - ./env/log/php:/data/log/php
            - ./projects/:/data/web/
            - ./env/conf/php/etc:/usr/local/etc:ro
        depends_on:
            - db
            - redis
        restart: on-failure:10
        container_name: dockered_php_7

    openresty:
        image: docker.ksyun.com/openresty:1.9.3.2
        ports:
            - 80:80
        volumes:
            - ./env/conf/openresty/nginx/conf:/usr/local/openresty/nginx/conf:ro
            - ./env/log/nginx:/data/log/nginx
        depends_on:
            - php
        container_name: dockered_openresty_19
        restart: on-failure:10

    db:
        image: mysql:8.0
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: kingsoft
        ports:
            - 3306:3306
        volumes:
            - ./env/conf/mysql:/etc/mysql/conf.d
            - ./env/mysql/data:/var/lib/mysql
            - ./env/log/mysql:/var/log/mysql
        container_name: dockered_mysql_57
        restart: on-failure:10

    redis:
        image: 'bitnami/redis:latest'
        restart: always
        environment:
            ALLOW_EMPTY_PASSWORD: 'yes'
        ports:
            - 6379:6379
        volumes:
            - ./env/redis/data:/bitnami
        container_name: dockered_redis_4
        restart: on-failure:10
    elasticsearch:
        image: 'elasticsearch:2-alpine'
        ports:
            - 9200:9200
            - 9300:9300
        container_name: dockered_es_2
        restart: on-failure:10

 

posted @ 2018-07-20 17:59  梦轻尘  阅读(1596)  评论(0编辑  收藏  举报