Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. version: "3.4"
  2.  
  3. networks:
  4. default:
  5. external:
  6. name: traefik_webgateway
  7.  
  8. services:
  9. php-fpm:
  10. env_file: .env.local
  11. build: # Info to build the Docker image
  12. context: . # Specify where the Dockerfile is located (e.g. in the root directory of the project)
  13. dockerfile: ./docker/Dockerfile-php # Specify the name of the Dockerfile
  14. labels:
  15. - traefik.enable=false
  16. volumes:
  17. - ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.
  18. - ./docker/php/php.ini:/usr/local/etc/php/php.ini
  19. container_name: php-fpm
  20. restart: on-failure
  21. command: >
  22. bash -c "php bin/console doctrine:database:drop --force \
  23. && php bin/console doctrine:database:create \
  24. && php bin/console doctrine:migrations:migrate --no-interaction \
  25. && php bin/console hautelook:fixtures:load -n \
  26. && php bin/console cache:clear \
  27. && yarn install \
  28. && yarn encore dev \
  29. ; php-fpm"
  30. depends_on:
  31. - db
  32.  
  33. nginx:
  34. image: nginx:latest
  35. volumes:
  36. - ./:/var/www/project/
  37. - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
  38. ports:
  39. - 8000:80 # Ports that are exposed, you can connect to port 8000 to port 80 of the container.
  40. container_name: nginx
  41. depends_on:
  42. - php-fpm
  43. links:
  44. - php-fpm
  45. labels:
  46. - traefik.web.frontend.rule=Host:gooddeeds.md.localhost
  47. - traefik.admin.frontend.rule=Host:cms.gooddeeds.md.localhost
  48.  
  49. db:
  50. env_file: .env.local
  51. image: postgres:11
  52. labels:
  53. - traefik.enable=false
  54. restart: on-failure
  55. working_dir: /var/www/project
  56. environment:
  57. POSTGRES_DB: ${DB_NAME}
  58. POSTGRES_USER: ${DB_USER}
  59. PGUSER: ${DB_USER}
  60. POSTGRES_PASSWORD: ${DB_PASS}
  61. volumes:
  62. - faptebune_db:/var/lib/postgresql/data # Persist the database in a Docker volume.
  63. ports:
  64. - 5432:5432
  65. container_name: postgres
  66. healthcheck:
  67. test: ["CMD", "pg_isready"]
  68. interval: 10s
  69. timeout: 2s
  70. retries: 3
  71.  
  72. composer:
  73. image: composer:latest
  74. command: >
  75. bash -c "composer install && composer dumpautoload -o"
  76. labels:
  77. - traefik.enable=false
  78. restart: on-failure
  79. environment:
  80. - GIT_SSH_COMMAND=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
  81. container_name: php-composer
  82. volumes:
  83. - ./:/app
  84.  
  85. volumes:
  86. faptebune_db:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement