upgrade alpine+glpi
This commit is contained in:
27
src/Dockerfile
Normal file
27
src/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
ARG ALPINE_VERSION
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
ARG GLPI_VERSION
|
||||
|
||||
RUN \
|
||||
mkdir -p /logs /config /files /marketplace && \
|
||||
apk -U upgrade && \
|
||||
apk add --no-cache curl nginx php82 php82-bz2 php82-ctype php82-curl php82-dom php82-exif \
|
||||
php82-fileinfo php82-fpm php82-gd php82-iconv php82-intl php82-ldap php82-mysqli \
|
||||
php82-opcache php82-openssl php82-pecl-apcu php82-pecl-redis php82-phar php82-session \
|
||||
php82-simplexml php82-sodium php82-tokenizer php82-xml php82-zip php82-xmlreader php82-xmlwriter && \
|
||||
wget -O /usr/local/bin/composer https://getcomposer.org/download/2.5.8/composer.phar && \
|
||||
chmod +x /usr/local/bin/composer && \
|
||||
wget -O - https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz | tar xz -C /var/www
|
||||
|
||||
# this are needed if you want to manually install GLPI from git
|
||||
# RUN \
|
||||
# apk add patch npm gettext
|
||||
|
||||
COPY rootfs /
|
||||
|
||||
# config test
|
||||
RUN nginx -t
|
||||
|
||||
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:80/fpm-ping
|
||||
|
||||
ENTRYPOINT [ "/bin/sh", "/start.sh" ]
|
||||
1
src/rootfs/etc/nginx/conf.d/glpi.conf
Normal file
1
src/rootfs/etc/nginx/conf.d/glpi.conf
Normal file
@@ -0,0 +1 @@
|
||||
daemon off;
|
||||
60
src/rootfs/etc/nginx/http.d/default.conf
Normal file
60
src/rootfs/etc/nginx/http.d/default.conf
Normal file
@@ -0,0 +1,60 @@
|
||||
client_body_temp_path /tmp/client_temp;
|
||||
proxy_temp_path /tmp/proxy_temp_path;
|
||||
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||
scgi_temp_path /tmp/scgi_temp;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
access_log /logs/nginx.access.log main;
|
||||
|
||||
sendfile off;
|
||||
|
||||
proxy_buffer_size 128k;
|
||||
proxy_buffers 4 256k;
|
||||
proxy_busy_buffers_size 256k;
|
||||
|
||||
root /var/www/glpi/public;
|
||||
index index.php index.html;
|
||||
|
||||
# Allow fpm ping and status from localhost
|
||||
location ~ ^/(fpm-status|fpm-ping)$ {
|
||||
access_log off;
|
||||
allow 127.0.0.1;
|
||||
deny all;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi.conf;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/index\.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
include fastcgi.conf;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
# Deny access to . files, for security
|
||||
location ~ /\. {
|
||||
log_not_found off;
|
||||
deny all;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/x-icon font/woff2 font/woff application/x-font-woff;
|
||||
gzip_disable "msie6";
|
||||
|
||||
etag on;
|
||||
if_modified_since exact;
|
||||
add_header Pragma "public";
|
||||
add_header Cache-Control "max-age=31536000, public";
|
||||
|
||||
6
src/rootfs/etc/php82/conf.d/php.ini
Normal file
6
src/rootfs/etc/php82/conf.d/php.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
session.cookie_httponly = on
|
||||
memory_limit = 256M
|
||||
file_uploads = on
|
||||
max_execution_time = 600
|
||||
session.auto_start = off
|
||||
session.use_trans_sid = 0
|
||||
11
src/rootfs/etc/php82/php-fpm.d/www.conf
Normal file
11
src/rootfs/etc/php82/php-fpm.d/www.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
[www]
|
||||
user = nginx
|
||||
group = www-data
|
||||
listen = 127.0.0.1:9000
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
ping.path = /fpm-ping
|
||||
pm.status_path = /fpm-status
|
||||
13
src/rootfs/start.sh
Normal file
13
src/rootfs/start.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
chown -R nginx:www-data /logs /config /files /marketplace
|
||||
chmod -R a-x,a=rX,ug+w /logs /config /files /marketplace
|
||||
|
||||
if [ "$INSTALL_OK" = "1" ] ; then
|
||||
if [ -f /var/www/glpi/install/install.php ] ; then
|
||||
rm /var/www/glpi/install/install.php
|
||||
fi
|
||||
fi
|
||||
|
||||
/usr/sbin/php-fpm*
|
||||
/usr/sbin/nginx
|
||||
5
src/rootfs/var/www/glpi/inc/downstream.php
Normal file
5
src/rootfs/var/www/glpi/inc/downstream.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
define('GLPI_CONFIG_DIR', '/config');
|
||||
define('GLPI_VAR_DIR', '/files');
|
||||
define('GLPI_MARKETPLACE_DIR', '/marketplace');
|
||||
Reference in New Issue
Block a user