PHP 7 with Apache for laravel / other projects
10K+
Apache2, PHP7 and Composer.
Folders and files View:
- apache ..* 000-default.conf
- project ..* project files laravel
- docker-compose.yml
Inside the folder type in the terminal: docker-compose up -d
To enter the container: docker exec -it container_name bash
Example to the docker-composer.yml file with MYSQL:
web:
image: php7-apache
ports:
- 80:80
volumes:
- ./project:/var/www/
- ./apache:/etc/apache2/sites-available/
links:
- mysql
mysql:
image: mysql
volumes:
- ./data/:/var/lib/mysql/
environment:
- MYSQL_ROOT_PASSWORD=teste123
- MYSQL_DATABASE=teste
- MYSQL_USER=root
- MYSQL_PASSWORD=teste123
ports:
- 3306:3306
Config to the 000-default.conf
For projects that do not use laravel delete /public from file.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Content type
Image
Digest
Size
182.5 MB
Last updated
over 9 years ago
docker pull fabiohan/php7-apache