-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
135 lines (92 loc) · 3.26 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
ARG GLPI_VERSION=10.0.16
ARG VERSION_PHP=8.2
FROM debian:bookworm-slim as prepare
ARG GLPI_VERSION
ARG VERSION_PHP
ENV GLPI_VERSION $GLPI_VERSION
ENV VERSION_PHP $VERSION_PHP
# RUN echo "Acquire::http::Proxy \"http://192.168.1.172:3142\";\nAcquire::https::Proxy \"http://192.168.1.172:3142\";" > /etc/apt/apt.conf.d/apt_proxy.conf
RUN apt update; \
apt install --no-install-recommends -y \
git \
curl \
jq \
lsb-release \
wget \
\
apt-transport-https \
ca-certificates;
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg;
RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] http://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list';
RUN export GLPI_URL=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${GLPI_VERSION} | jq .assets[0].browser_download_url | tr -d \"); \
export TAR_FILENAME=$(basename ${GLPI_URL}); \
wget -P /tmp/ ${GLPI_URL}; \
tar -xzf /tmp/${TAR_FILENAME} -C /tmp;
FROM debian:bookworm-slim
LABEL \
org.opencontainers.image.vendor="No Fuss Computing" \
org.opencontainers.image.title="GLPI" \
org.opencontainers.image.description="GLPI Within a docker container" \
org.opencontainers.image.vendor="No Fuss Computing" \
io.artifacthub.package.license="MIT"
ARG GLPI_VERSION
ARG VERSION_PHP
ENV DEBIAN_FRONTEND noninteractive
ENV GLPI_VERSION $GLPI_VERSION
ENV VERSION_PHP $VERSION_PHP
#COPY --from=prepare /etc/apt/apt.conf.d/apt_proxy.conf /etc/apt/apt.conf.d/apt_proxy.conf
COPY --from=prepare /usr/share/keyrings/deb.sury.org-php.gpg /usr/share/keyrings/deb.sury.org-php.gpg
COPY --from=prepare /etc/apt/sources.list.d/php.list /etc/apt/sources.list.d/php.list
RUN apt update; \
apt install --no-install-recommends -y \
ca-certificates \
\
cron \
supervisor; \
rm -rf /var/lib/apt/lists/*;
RUN apt update; \
apt install --no-install-recommends -y \
apache2 \
php$VERSION_PHP \
php$VERSION_PHP-mysql \
php$VERSION_PHP-ldap \
php$VERSION_PHP-xmlrpc \
php$VERSION_PHP-imap \
php$VERSION_PHP-curl \
php$VERSION_PHP-gd \
php$VERSION_PHP-mbstring \
php$VERSION_PHP-xml \
php-cas \
php$VERSION_PHP-intl \
php$VERSION_PHP-zip \
php$VERSION_PHP-bz2 \
php$VERSION_PHP-redis; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /var/www/html; \
rm -f /etc/apt/apt.conf.d/apt_proxy.conf; \
a2enmod rewrite;
COPY --from=prepare /tmp/glpi /var/www/html
# RUN apt install --no-install-recommends -y \
# libldap-2.4-2 \
# libldap-common \
# libsasl2-2 \
# libsasl2-modules \
# libsasl2-modules-db;
RUN chown www-data:www-data -R /var/www; \
ln -s /var/www/html/bin/console /bin/console; \
touch /apache-passwd-glpi-inventory; \
chown www-data:www-data /apache-passwd-glpi-inventory; \
chmod 740 /apache-passwd-glpi-inventory;
VOLUME /var/www/html/config
VOLUME /var/www/html/data
VOLUME /var/www/html/files
VOLUME /var/www/html/plugins
VOLUME /var/www/html/marketplacey
VOLUME /var/log
COPY includes/ /
RUN chmod 644 -R /etc/cron.d
WORKDIR /var/www/html
EXPOSE 80 443 9001
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD \
supervisorctl status || exit 1
CMD [ "/usr/bin/supervisord" ]