Guest User

Untitled

a guest
Nov 30th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. # vbernabe
  2. # This is a docker config to run containers with nginx, php, mariadb, redis, composer, adminer
  3. # Environment variables setup the db user and pass so use it to connect
  4. # Volumes will map the folder from your host machine to the container
  5. # Links I use links to let the app container know to connect to the db container
  6. version: "3.1"
  7. services:
  8. php:
  9. build:
  10. context: .
  11. dockerfile: Dockerfile
  12. container_name: org-php-project-name
  13. # Start below containers first
  14. depends_on:
  15. - mariadb
  16. - redis
  17. volumes:
  18. - "./src/public/app:/var/www/html/public/app:delegated"
  19. - "./config/php/php.ini:/usr/local/etc/php/php.ini"
  20. environment:
  21. - "DB_HOST=mariadb" #connect to this mariadb host - use this on your src code config
  22. - "REDIS_HOST=redis" #connect to this redis host - use this on your src code config
  23. links:
  24. - mariadb
  25. - redis
  26.  
  27. composer:
  28. image: composer:latest
  29. container_name: org-composer-project-name
  30. volumes:
  31. - "./src/public/app:/app" # location of your composer.json file
  32. command: install
  33.  
  34. mariadb:
  35. image: mariadb:latest
  36. container_name: org-mariadb-project-name
  37. ports:
  38. - "3306:3306"
  39. volumes:
  40. - "./db-data:/var/lib/mysql" # location of mysql data
  41. environment:
  42. - "MYSQL_USER=orguser"
  43. - "MYSQL_PASSWORD=xxxxxxxxxxxxxxxxxxx"
  44. - "MYSQL_ROOT_PASSWORD=xxxxxxxxxxxxxxxxxxx"
  45.  
  46. nginx:
  47. image: nginx:latest
  48. container_name: org-nginx-project-name
  49. depends_on:
  50. - composer
  51. - php
  52. environment:
  53. - FASTCGI_PASS_HOST=php
  54. ports:
  55. - "80:80"
  56. - "443:443"
  57. volumes:
  58. - "./src/public/app:/var/www/html/public/app" # location of document root
  59. - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" # your nginx config
  60. - "./config/certs:/etc/nginx/certs" # location of nginx ssl files
  61. - "./logs/nginx:/var/log/nginx" # location of nginx logs so you can tail logs outside i.e. no need to login to container
  62. links:
  63. - php
  64.  
  65. adminer:
  66. image: adminer
  67. container_name: org-adminer-project-name
  68. ports:
  69. - 8080:8080
  70.  
  71. redis:
  72. image: redis:latest
  73. container_name: org-redis-project-name
  74. ports:
  75. - "6379:6379"
  76. volumes:
  77. - "./redis-data:/data" # location of redis data
  78. command: redis-server --appendonly yes
Add Comment
Please, Sign In to add comment