Advertisement
Guest User

Untitled

a guest
May 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. # Some notes on how to get Symfony up and running with Docker and MySQL.
  2.  
  3. # Two images are pulled down PHP-Apache and MySQL.
  4. # The PHP-Apache sites-available default is overwritten by a local file.
  5. # The PHP pdo-mysql extension needs to be installed.
  6.  
  7. # docker-compose.yml
  8.  
  9. version: "3"
  10. services:
  11.  
  12. web:
  13. container_name: symfony_web
  14. build:
  15. context: .
  16. dockerfile: docker/web/Dockerfile
  17. ports:
  18. - "8080:80"
  19. volumes:
  20. - .:/var/www/html/symfony-starter
  21. - ./docker/vhosts/vhosts.conf:/etc/apache2/sites-available/000-default.conf
  22. depends_on:
  23. - data
  24. environment:
  25. - APACHE_DOCUMENT_ROOT=/var/www/html/symfony-starter/public
  26.  
  27. data:
  28. container_name: symfony_data
  29. image: mysql:5.7
  30. environment:
  31. - MYSQL_ROOT_PASSWORD=123456
  32. ports:
  33. - "3306:3306"
  34.  
  35.  
  36. # The Apache PHP 7.3 Dockerfile
  37.  
  38. FROM php:7.3-apache
  39.  
  40. RUN a2enmod rewrite headers && docker-php-ext-install pdo pdo_mysql
  41.  
  42. COPY . /var/www/html/symfony-starter
  43.  
  44. WORKDIR /var/www/html/symfony-starter
  45.  
  46.  
  47. # The vhosts.conf file
  48.  
  49. <VirtualHost *:80>
  50. DocumentRoot ${APACHE_DOCUMENT_ROOT}
  51.  
  52. <Directory ${APACHE_DOCUMENT_ROOT}>
  53. Options Indexes
  54. DirectoryIndex index.php
  55. Require all granted
  56. AllowOverride all
  57. RewriteEngine On
  58. Options Indexes FollowSymLinks
  59. RewriteRule ^([a-z0-9_/]+)$ index.php/$1 [L,NC]
  60. </Directory>
  61. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement