Laravel 5.5 is built on docker
Docker container with php 7.1 on Apache (httpd). Based on an docker-compose.yml file
- Docker and Docekr-compose
- GIT
- clone this repository
git clone https://github.com/meysam-mahmoodi/docker-laravel55.git
- navigate to it
cd docker-laravel55
- Build docker image:
docker-compose build
- Run it:
docker run -d --name laravel55 -p 80:80 docker-php7-apache2_php7
- Install Composer inside it:
docker exec -w /var/www/html laravel55 sh -c "curl --silent --show-error https://getcomposer.org/installer | php"
- Install php packages:
docker exec -w /var/www/html laravel55 php composer.phar install
- create a
.env
file:docker exec -w /var/www/html cp .env.example .env
- generate a key:
docker exec -w /var/www/html php artisan key:generate
- Open
http://localhost/public
orhttp://your-server-ip-adress/public
Showing logs : docker logs -f laravel55
Enabling php logs
- Attach the container:
docker exec -it laravel55 /bin/bash
- install nano:
apt-get install nano
- Create and open a php.ini:
nano /usr/local/etc/php/php.ini
- insert it content of file
etc/php/php.ini
- change
display_errors = Off
todisplay_errors = On
- exit from container:
exit
- restart the container
docker restart laravel55