forked from Turgon37/docker-glpi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- parameters for new version docker-php-ext-configure >php 7.3 - add py3-pip (pip3) - last alpine version for PHP - Add Dockerfile_nginx-74 for php 7.4 - sync with Turgon37 repository
- Loading branch information
1 parent
28891c5
commit ed2e562
Showing
7 changed files
with
171 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ RUN curl --silent --show-error --fail --remote-name-all \ | |
&& rm -fv composer.json | ||
|
||
# Second stage : build final image | ||
FROM php:7.2-fpm-alpine3.11 | ||
FROM php:7.2-fpm-alpine | ||
|
||
LABEL maintainer='Pierre GINDRAUD <[email protected]>' | ||
|
||
|
@@ -63,6 +63,7 @@ RUN set -ex; \ | |
iputils \ | ||
net-snmp-libs \ | ||
py3-jinja2 \ | ||
py3-pip \ | ||
supervisor \ | ||
tar \ | ||
tzdata \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# First stage : download glpi + build it | ||
FROM composer:latest as build_glpi | ||
|
||
ARG GLPI_VERSION | ||
ARG GLPI_PATHS_ROOT=/var/www | ||
|
||
RUN mkdir -p "${GLPI_PATHS_ROOT}" | ||
RUN curl -v --fail -o glpi.tgz -L "https://github.com/glpi-project/glpi/releases/download/${GLPI_VERSION}/glpi-${GLPI_VERSION}.tgz" \ | ||
&& tar -xzf glpi.tgz --strip 1 --directory ${GLPI_PATHS_ROOT} | ||
|
||
WORKDIR "${GLPI_PATHS_ROOT}" | ||
|
||
RUN curl --silent --show-error --fail --remote-name-all \ | ||
https://raw.githubusercontent.com/glpi-project/glpi/${GLPI_VERSION}/composer.json \ | ||
https://raw.githubusercontent.com/glpi-project/glpi/${GLPI_VERSION}/composer.lock \ | ||
&& COMPOSER_HOME=/tmp/composer composer require \ | ||
--apcu-autoloader \ | ||
--classmap-authoritative \ | ||
--ignore-platform-reqs \ | ||
--no-interaction \ | ||
--no-progress \ | ||
--no-suggest \ | ||
--optimize-autoloader \ | ||
--prefer-dist \ | ||
--update-no-dev \ | ||
--working-dir ${GLPI_PATHS_ROOT} \ | ||
apereo/phpcas \ | ||
&& rm -fv composer.json | ||
|
||
# Second stage : build final image | ||
FROM php:7.4-fpm-alpine | ||
|
||
LABEL maintainer='Pierre GINDRAUD <[email protected]>' | ||
|
||
ARG GLPI_VERSION | ||
ARG GLPI_PHP_XDEBUG | ||
|
||
ENV GLPI_VERSION "${GLPI_VERSION}" | ||
ENV GLPI_PATHS_ROOT /var/www | ||
ENV GLPI_PATHS_PLUGINS /var/www/plugins | ||
ENV GLPI_REMOVE_INSTALLER no | ||
ENV GLPI_CHMOD_PATHS_FILES no | ||
ENV GLPI_INSTALL_PLUGINS '' | ||
ENV PHP_XDEBUG "${GLPI_PHP_XDEBUG}" | ||
|
||
ENV PHP_MEMORY_LIMIT 64M | ||
|
||
ENV PHPFPM_PM dynamic | ||
ENV PHPFPM_PM_MAX_CHILDREN 20 | ||
ENV PHPFPM_PM_START_SERVERS 4 | ||
ENV PHPFPM_PM_MIN_SPARE_SERVERS 2 | ||
ENV PHPFPM_PM_MAX_SPARE_SERVERS 4 | ||
ENV PHPFPM_PM_PROCESS_IDLE_TIMEOUT 20s | ||
ENV PHPFPM_PM_MAX_REQUEST 1000 | ||
|
||
# Install dependencies | ||
RUN set -ex; \ | ||
apk --no-cache add \ | ||
curl \ | ||
nginx \ | ||
fping \ | ||
graphviz \ | ||
iputils \ | ||
net-snmp-libs \ | ||
py3-jinja2 \ | ||
py3-pip \ | ||
supervisor \ | ||
tar \ | ||
tzdata \ | ||
; \ | ||
pip3 install \ | ||
j2cli \ | ||
jinja2-getenv-extension \ | ||
; \ | ||
apk add --no-cache --virtual .build-deps \ | ||
$PHPIZE_DEPS \ | ||
autoconf \ | ||
bzip2-dev \ | ||
coreutils \ | ||
curl-dev \ | ||
freetype-dev \ | ||
icu-dev \ | ||
imap-dev \ | ||
libevent-dev \ | ||
libjpeg-turbo-dev \ | ||
libmcrypt-dev \ | ||
libpng-dev \ | ||
libxml2-dev \ | ||
libzip-dev \ | ||
libpng-dev \ | ||
net-snmp-dev \ | ||
openldap-dev \ | ||
pcre-dev \ | ||
imagemagick-dev \ | ||
; \ | ||
docker-php-source extract ; \ | ||
docker-php-ext-configure gd --with-freetype=/usr --with-jpeg=/usr; \ | ||
docker-php-ext-configure ldap ; \ | ||
docker-php-ext-install \ | ||
bz2 \ | ||
exif \ | ||
gd \ | ||
imap \ | ||
intl \ | ||
ldap \ | ||
mysqli \ | ||
opcache \ | ||
snmp \ | ||
soap \ | ||
xmlrpc \ | ||
zip \ | ||
; \ | ||
pecl install apcu && docker-php-ext-enable apcu ; \ | ||
if [[ "$GLPI_PHP_XDEBUG" = "yes" ]] ; then \ | ||
pecl install xdebug-3.0.0 && docker-php-ext-enable xdebug ; \ | ||
else \ | ||
echo "PHP_XDEBUG is not build" ; \ | ||
fi ; \ | ||
docker-php-source delete ; \ | ||
runDeps="$( \ | ||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ | ||
| tr ',' '\n' \ | ||
| sort -u \ | ||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ | ||
)"; \ | ||
apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ | ||
apk del .build-deps ; \ | ||
mkdir -p /run/nginx ; \ | ||
find "${GLPI_PATHS_ROOT}" -mindepth 1 -maxdepth 1 -not -name '.*' -and -not -name '..' | xargs rm -rfv | ||
|
||
# Copy glpi build | ||
COPY --from=build_glpi --chown=www-data:www-data ${GLPI_PATHS_ROOT} ${GLPI_PATHS_ROOT} | ||
|
||
# Add some configurations files | ||
RUN if [[ "$GLPI_PHP_XDEBUG" = "yes" ]] ; then \ | ||
echo "Xdebug is on"; \ | ||
else \ | ||
rm -f root\etc\php-fpm.d\xdebug.ini.j2 ; \ | ||
fi ; | ||
|
||
COPY root/ / | ||
COPY /docker-entrypoint.sh / | ||
COPY /docker-entrypoint.d/* /docker-entrypoint.d/ | ||
|
||
RUN chmod -R +x /docker-entrypoint.d/ /usr/local/bin/cronwrapper.py \ | ||
&& chmod -R g=rX,o=--- /var/www/* \ | ||
&& addgroup nginx www-data | ||
|
||
EXPOSE 80/tcp | ||
VOLUME ["/var/www/files", "/var/www/config"] | ||
WORKDIR "${GLPI_PATHS_ROOT}" | ||
|
||
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \ | ||
CMD curl --silent http://127.0.0.1:80/fpm-ping | grep -q pong || exit 1 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["/usr/bin/supervisord", "--configuration", "/etc/supervisord.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters