mz

docker-compose 几个常用的yml

优秀的git地址:

dnmp =https://github.com/Tinywan/dnmp

使用docker-compose部署LNMP环境,基础Linux,Nginx,MySQL5.7,PHP7.2,Redis5.0,PHPMyAdmin

dnmp+swoole = https://github.com/twose/swoole-docker

适合高级开发人员的完美Swoole Dockerfile

 

 

version: "2"
services:
  php:
    image: php:7.2.3-fpm
    networks:
      - lnmp
    volumes:
       -  ./web:/web
    environment:
      - TZ=Asia/Shanghai
  nginx:
    image: nginx:1.15
    networks:
      - lnmp
    ports:
      - 80:80
    volumes:
      - ./web:/web
      - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf
      - /etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
    environment:
      - TZ=Asia/Shanghai
    links:
      - php
networks:
  lnmp:
dev.mysql.srv:
    image: mysql:5.7.22
  volumes:
        - ./mysql/data:/var/lib/mysql
      - ./mysql/conf:/etc/mysql/conf.d
    ports:
        - "3307:3306"
    restart: always
    environment:
        MYSQL_ROOT_PASSWORD: 123123
    networks:
        - default

dev.nginx.srv:
    image: lei_nginx:1.14.0
    build: ./nginx
    volumes:
        - ./nginx/conf:/home/work/app/nginx/conf
      - ./www:/home/work/www
    ports:
        - "80:8080"
      - "443:443"
    restart: always
    networks:
        - default
    depends_on:
      - dev.php-fpm.srv
dev.redis.srv:
    image: lei_redis:3.2.11
    build: ./redis
    volumes:
        - ./redis/conf:/home/work/app/redis/conf
      - ./redis/data:/home/work/app/redis/data
    ports:
      - "6379:6379"
    restart: always
    networks:
      - default
dev.php-fpm.srv:
    image: lei_php:7.2.6
    build: ./php7
    volumes:
        - ./php7/etc:/home/work/app/php/etc
        - ./www:/home/work/www
    ports:
        - "9000:9000"
    restart: always
    networks:
        - default

 

码字很辛苦,转载请注明来自明志博客《docker-compose 几个常用的yml》

评论