mirror of
https://github.com/DiouxX/docker-glpi.git
synced 2026-11-04 14:42:33 -05:00
Add cron to Dockerfile install. Change glpi-start.sh to add cron file to
the right directory and start cron at start before apache2ctl
This commit is contained in:
1 parent
870a041ae7
commit
3b2f81ab30
4 files changed
+58
-32
No files matched your search
+2
-1
@@ -21,7 +21,8 @@ php-gd \
|
||||
php-mbstring \
|
||||
php-xml \
|
||||
php-apcu-bc \
|
||||
wget
|
||||
wget \
|
||||
cron
|
||||
|
||||
#Copie et execution du script pour l'installation et l'initialisation de GLPI
|
||||
COPY glpi-start.sh /opt/
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
#GLPI Container
|
||||
glpi:
|
||||
build: ./
|
||||
image: myglpi
|
||||
container_name : myglpi
|
||||
ports:
|
||||
- "9080:80"
|
||||
links:
|
||||
- mysql:mysql
|
||||
restart: always
|
||||
|
||||
#Mysql Container
|
||||
mysql:
|
||||
image: mysql
|
||||
container_name: mysql
|
||||
hostname: mysql
|
||||
env_file:
|
||||
- ./mysql.env
|
||||
+33
-29
@@ -1,36 +1,40 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
#Mysql Persitance Data
|
||||
mysql-data:
|
||||
image: busybox
|
||||
container_name: mysql-data
|
||||
volumes:
|
||||
- /var/lib/mysql:/var/lib/mysql
|
||||
mysql-data:
|
||||
image: busybox
|
||||
container_name: mysql-data
|
||||
volumes:
|
||||
- /var/lib/mysql:/var/lib/mysql
|
||||
|
||||
#Mysql Container
|
||||
mysql:
|
||||
image: mysql
|
||||
container_name: mysql
|
||||
hostname: mysql
|
||||
volumes_from:
|
||||
- mysql-data
|
||||
env_file:
|
||||
- ./mysql.env
|
||||
mysql:
|
||||
image: mysql
|
||||
container_name: mysql
|
||||
hostname: mysql
|
||||
volumes_from:
|
||||
- mysql-data
|
||||
env_file:
|
||||
- ./mysql.env
|
||||
|
||||
#GLPI Pesitance Data
|
||||
glpi-data:
|
||||
image: busybox
|
||||
container_name: glpi-data
|
||||
volumes:
|
||||
- /var/www/html/glpi:/var/www/html/glpi
|
||||
glpi-data:
|
||||
image: busybox
|
||||
container_name: glpi-data
|
||||
volumes:
|
||||
- /var/www/html/glpi:/var/www/html/glpi
|
||||
|
||||
#GLPI Container
|
||||
glpi:
|
||||
image: diouxx/glpi
|
||||
container_name : glpi
|
||||
hostname: glpi
|
||||
ports:
|
||||
- "80:80"
|
||||
links:
|
||||
- mysql:mysql
|
||||
volumes_from:
|
||||
- glpi-data
|
||||
restart: always
|
||||
glpi:
|
||||
build: ./
|
||||
image: myglpi
|
||||
container_name : myglpi
|
||||
hostname: glpi
|
||||
ports:
|
||||
- "80:80"
|
||||
links:
|
||||
- mysql:mysql
|
||||
volumes_from:
|
||||
- glpi-data
|
||||
restart: always
|
||||
+2
-2
@@ -31,10 +31,10 @@ fi
|
||||
echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi\n\n\t<Directory /var/www/html/glpi>\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
#Add scheduled task by cron
|
||||
echo "*/5 * * * * /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron
|
||||
echo "*/5 * * * * root /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron.d/glpicron
|
||||
|
||||
#Activation du module rewrite d'apache
|
||||
a2enmod rewrite && service apache2 restart && service apache2 stop
|
||||
|
||||
#Lancement du service apache au premier plan
|
||||
/usr/sbin/apache2ctl -D FOREGROUND
|
||||
cron -f & /usr/sbin/apache2ctl -D FOREGROUND
|
||||
Reference in new issue
Block a user