×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: pery mimon
Added: Mar 8, 2017 3:19 PM
Views: 6
Tags: docker compose
good cover docker-compose.yml
  1. version: "2.1"
  2. services:
  3.   nginx:
  4.       build: ./nginx/
  5.       ports:
  6.         - 80:80
  7.       volumes:
  8.         - "${PROJECT_ROOT}:/var/www/html:ro"
  9.       networks:
  10.         - server
  11.       depends_on:
  12.         - php
  13.  
  14.   php:
  15.       build: ./php/
  16.       expose:
  17.           - 9000
  18.       depends_on:
  19.           - mysql
  20.       volumes:
  21.          - "${PROJECT_ROOT}:/var/www/html"
  22.       networks:
  23.         - database
  24.         - server
  25.  
  26.   mysql:
  27.       image: mysql:latest
  28.       volumes:
  29.           - data:/var/lib/mysql
  30.       networks:
  31.           - database
  32.       environment:
  33.           MYSQL_ROOT_PASSWORD: secret
  34.           MYSQL_DATABASE: project
  35.           MYSQL_USER: project
  36.           MYSQL_PASSWORD: project
  37.  
  38.   phpmyadmin:
  39.       image: phpmyadmin/phpmyadmin
  40.       ports:
  41.         - 8080:80
  42.       depends_on:
  43.         - mysql
  44.       networks:
  45.         - database
  46.       environment:
  47.         PMA_HOST: mysql
  48.  
  49. volumes:
  50.     data:
  51.  
  52. networks:
  53.     database:
  54.     server: