Ajouter glpi/Dockerfile
This commit is contained in:
parent
5dd5cc2db5
commit
52e4ecf13b
1 changed files with 72 additions and 0 deletions
72
glpi/Dockerfile
Normal file
72
glpi/Dockerfile
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
FROM almalinux:9
|
||||
|
||||
# Valeurs par défaut pour l'utilisateur du host
|
||||
ARG HOST_USER_ID=1000
|
||||
ARG HOST_GROUP_ID=1000
|
||||
|
||||
# Install system tools and PHP/Nginx/FPM
|
||||
RUN dnf -y update && \
|
||||
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm && \
|
||||
dnf module reset -y php && \
|
||||
dnf module enable -y php:remi-8.3 && \
|
||||
dnf -y install \
|
||||
gettext \
|
||||
mysql \
|
||||
nginx \
|
||||
php \
|
||||
php-fpm \
|
||||
php-mysqlnd \
|
||||
php-gd \
|
||||
php-intl \
|
||||
php-xml \
|
||||
php-mbstring \
|
||||
php-curl \
|
||||
php-ldap \
|
||||
php-opcache \
|
||||
php-zip && \
|
||||
dnf -y install epel-release && \
|
||||
dnf -y install \
|
||||
supervisor \
|
||||
unzip \
|
||||
wget \
|
||||
nano \
|
||||
tar && \
|
||||
dnf clean all
|
||||
|
||||
RUN groupmod -g ${HOST_GROUP_ID} nginx && \
|
||||
usermod -u ${HOST_USER_ID} -g ${HOST_GROUP_ID} nginx
|
||||
|
||||
# Create folders for Supervisor and GLPI
|
||||
RUN mkdir -p /var/log/supervisord /etc/supervisor/conf.d /var/www/html \
|
||||
mkdir -p /run/php-fpm && \
|
||||
chown nginx:nginx /run/php-fpm
|
||||
|
||||
|
||||
# Patch PHP-FPM to listen on TCP (avoid socket permission hell)
|
||||
RUN sed -i 's|^listen = .*|listen = 127.0.0.1:9000|' /etc/php-fpm.d/www.conf && \
|
||||
sed -i 's/^daemonize = yes/daemonize = no/' /etc/php-fpm.conf && \
|
||||
sed -i 's/^user = .*/user = nginx/' /etc/php-fpm.d/www.conf && \
|
||||
sed -i 's/^group = .*/group = nginx/' /etc/php-fpm.d/www.conf && \
|
||||
echo "daemon off;" >> /etc/nginx/nginx.conf
|
||||
|
||||
|
||||
# Copy your provided nginx and supervisord conf
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY supervisord.conf /etc/supervisord.conf
|
||||
COPY default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
|
||||
# Optional: download and unpack GLPI (latest stable as of 2025)
|
||||
WORKDIR /tmp
|
||||
RUN wget https://github.com/glpi-project/glpi/releases/download/10.0.18/glpi-10.0.18.tgz && \
|
||||
tar -xzf glpi-10.0.18.tgz && \
|
||||
mv glpi/* /var/www/html/ && \
|
||||
chown -R nginx:nginx /var/www/html
|
||||
|
||||
# Expose HTTP port
|
||||
EXPOSE 80
|
||||
|
||||
# Add entrypoint
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue