Narven
5/13/2018 - 11:25 PM

dc-nginx-php-mysql-code.yml

version: '2'
services:

  web:
    image: nginx
    ports:
      - "80:80"
      - "443:443"
    links:
      - php
      - mysql
    volumes:
      - ./sites:/etc/nginx/conf.d
      - ./conf/nginx.conf:/etc/nginx/nginx.conf
    volumes_from:
      - code

  php:
    build: .
    working_dir: /var/www
    volumes_from:
      - code

  mysql:
    image: mysql
    ports:
      - "33061:3306"
      - "3306:3306"
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password

  code:
    image: busybox
    volumes:
      - ./www:/var/www