mirror of
https://github.com/DiouxX/docker-glpi.git
synced 2026-11-04 14:42:33 -05:00
Add script glpi-start.sh to deploy and enable volume sharing features
This commit is contained in:
1 parent
06f49af106
commit
6dcb03ffcc
3 files changed
+40
-25
No files matched your search
+4
-25
@@ -1,5 +1,3 @@
|
||||
#Dockerfile pour créer une image docker de GLPi fonctionnelle (avec apache2 et php5)
|
||||
|
||||
#On choisit une debian
|
||||
FROM debian:latest
|
||||
|
||||
@@ -8,12 +6,6 @@ MAINTAINER DiouxX "github@diouxx.be"
|
||||
#Ne pas poser de question à l'installation
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV VERSION_GLPI 0.90.5
|
||||
ENV SRC_GLPI https://github.com/glpi-project/glpi/releases/download/${VERSION_GLPI}/glpi-${VERSION_GLPI}.tar.gz
|
||||
ENV TAR_GLPI glpi-${VERSION_GLPI}.tar.gz
|
||||
ENV FOLDER_GLPI glpi/
|
||||
ENV FOLDER_WEB /var/www/html/
|
||||
|
||||
#Installation d'apache et de php5 avec extension
|
||||
RUN apt update \
|
||||
&& apt -y install \
|
||||
@@ -28,23 +20,10 @@ php5-curl \
|
||||
php5-gd \
|
||||
wget
|
||||
|
||||
#Téléchargement des sources de GLPI
|
||||
RUN wget -P ${FOLDER_WEB} ${SRC_GLPI} \
|
||||
&& tar -xf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB}\
|
||||
&& rm -Rf ${FOLDER_WEB}${TAR_GLPI} \
|
||||
&& chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI}
|
||||
|
||||
#Modification du fichier
|
||||
RUN echo "<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
|
||||
|
||||
#Activation du module rewrite d'apache
|
||||
RUN a2enmod rewrite && service apache2 restart
|
||||
#Copie et execution du script pour l'installation et l'initialisation de GLPI
|
||||
COPY glpi-start.sh /opt/
|
||||
RUN chmod +x /opt/glpi-start.sh
|
||||
ENTRYPOINT ["/opt/glpi-start.sh"]
|
||||
|
||||
#Exposition des ports
|
||||
EXPOSE 80 443
|
||||
|
||||
#Partage du volume
|
||||
VOLUME /var/www/html/glpi
|
||||
|
||||
#Lancement du service apache a l'initialisation du conteneur
|
||||
ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
|
||||
@@ -15,6 +15,13 @@ mysql:
|
||||
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 Container
|
||||
glpi:
|
||||
image: diouxx/glpi
|
||||
@@ -24,3 +31,5 @@ glpi:
|
||||
- "80:80"
|
||||
links:
|
||||
- mysql:mysql
|
||||
volumes_from:
|
||||
- glpi-data
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION_GLPI=0.90.5
|
||||
SRC_GLPI=https://github.com/glpi-project/glpi/releases/download/${VERSION_GLPI}/glpi-${VERSION_GLPI}.tar.gz
|
||||
TAR_GLPI=glpi-${VERSION_GLPI}.tar.gz
|
||||
FOLDER_GLPI=glpi/
|
||||
FOLDER_WEB=/var/www/html/
|
||||
|
||||
#Téléchargement et extraction des sources de GLPI
|
||||
if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ];
|
||||
then
|
||||
echo "GLPI is already installed"
|
||||
else
|
||||
wget -P ${FOLDER_WEB} ${SRC_GLPI}
|
||||
tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB}
|
||||
rm -Rf ${FOLDER_WEB}${TAR_GLPI}
|
||||
chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI}
|
||||
fi
|
||||
|
||||
#Modification du vhost par défaut
|
||||
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
|
||||
|
||||
#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
|
||||
Reference in new issue
Block a user