search

Home  >  Q&A  >  body text

lnmp - Docker:寻找一些docker-compose.yml文件的示例

用Docker部署一个Lnmp环境,要写一个nginx+mariadb+php+redis的docker-compose.yml,看了一下官方文档,给了一个格式,像下面这样:
链接在此: https://docs.docker.com/compose/compose-file/#versioning

version: '2'
services:
  web:
    build: .
    ports:
     - "5000:5000"
    volumes:
     - .:/code
    networks:
      - front-tier
      - back-tier
  redis:
    image: redis
    volumes:
      - redis-data:/var/lib/redis
    networks:
      - back-tier
volumes:
  redis-data:
    driver: local
networks:
  front-tier:
    driver: bridge
  back-tier:
    driver: bridge

但看了仍然不知道该怎么写这个文件,把github上能搜到的基本浏览了一遍,但是有点五花八门,看了不知道参考哪个,有点混淆。请大神们提供一些参考示例。

备注:
上面涉及到的镜像打算使用Docker Hub上的官方镜像最新版。
操作系统是centos7.2。

天蓬老师天蓬老师2775 days ago715

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-24 09:13:53

    This is pretty good, the basic PHP technology stack is used
    https://github.com/kasperisager/php-dockerized

    It is recommended to read this blog
    http://avnpc.com/pages/build-php-develop-env-by-docker

    should fit your needs

    reply
    0
  • PHP中文网

    PHP中文网2017-04-24 09:13:53

    Docker from entry to practice

    It is recommended to take a look at this

    reply
    0
  • Cancelreply