Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Some notes on how to get Symfony up and running with Docker and MySQL.
- # Two images are pulled down PHP-Apache and MySQL.
- # The PHP-Apache sites-available default is overwritten by a local file.
- # The PHP pdo-mysql extension needs to be installed.
- # docker-compose.yml
- version: "3"
- services:
- web:
- container_name: symfony_web
- build:
- context: .
- dockerfile: docker/web/Dockerfile
- ports:
- - "8080:80"
- volumes:
- - .:/var/www/html/symfony-starter
- - ./docker/vhosts/vhosts.conf:/etc/apache2/sites-available/000-default.conf
- depends_on:
- - data
- environment:
- - APACHE_DOCUMENT_ROOT=/var/www/html/symfony-starter/public
- data:
- container_name: symfony_data
- image: mysql:5.7
- environment:
- - MYSQL_ROOT_PASSWORD=123456
- ports:
- - "3306:3306"
- # The Apache PHP 7.3 Dockerfile
- FROM php:7.3-apache
- RUN a2enmod rewrite headers && docker-php-ext-install pdo pdo_mysql
- COPY . /var/www/html/symfony-starter
- WORKDIR /var/www/html/symfony-starter
- # The vhosts.conf file
- <VirtualHost *:80>
- DocumentRoot ${APACHE_DOCUMENT_ROOT}
- <Directory ${APACHE_DOCUMENT_ROOT}>
- Options Indexes
- DirectoryIndex index.php
- Require all granted
- AllowOverride all
- RewriteEngine On
- Options Indexes FollowSymLinks
- RewriteRule ^([a-z0-9_/]+)$ index.php/$1 [L,NC]
- </Directory>
- </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement