Service docker, for load php7 laravel
docker-compose file:
version: "3"
services:
app-sisep:
image: php7:minedu
restart: always
volumes:
- "/usr/share/zoneinfo/America/La_Paz:/etc/localtime:ro"
- /home/php-projects/sisep:/var/www/app
- /home/php-projects/sisep/docker/init.sh:/usr/local/bin/init.sh
- /home/php-projects/sisep/docker/000-default.conf:/etc/apache2/sites-enabled/000-default.conf
- /home/php-projects/sisep/docker/ports.conf:/etc/apache2/ports.conf
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "2"
command: bash -c "sh /usr/local/bin/init.sh"
network_mode: bridge
ports:
- "80:80"
init.sh:
#!/bin/bash
clear
echo "Initializing laravel project"
a2enmod rewrite
service apache2 start
current_time=$(date "+%Y-%m-%d-%H-%M-%S")
cat /var/www/app/storage/logs/laravel.log > /var/www/app/storage/logs/"$current_time.log"
echo "PHP 7.2 ready to listen to requests !" > /var/www/app/storage/logs/laravel.log
tail -f /var/www/app/storage/logs/laravel.log
000-default.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/app/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
ports.conf:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
Content type
Image
Digest
Size
143.2 MB
Last updated
over 5 years ago
docker pull ugpsep/php7:ip-172