Public Repository

Last pushed: 6 months ago
Short Description
PHP 7 with Apache for laravel / other projects
Full Description

Installed

Apache2, PHP7 and Composer.

The Container

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

docker-compose.yml

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

Apache file

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>
Docker Pull Command
Owner
fabiohan

Comments (0)