forked from devinsolutions/docker-osticket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
137 lines (128 loc) · 4.55 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
136
137
FROM php:8.1-fpm-alpine3.16
RUN set -ex; \
\
export CFLAGS="${PHP_CFLAGS:?}"; \
export CPPFLAGS="${PHP_CPPFLAGS:?}"; \
export LDFLAGS="${PHP_LDFLAGS:?} -Wl,--strip-all"; \
\
# Runtime dependencies
apk add --no-cache \
c-client \
icu \
libintl \
libpng \
libzip \
msmtp \
nginx \
openldap \
runit \
; \
\
# Build dependencies
apk add --no-cache --virtual .build-deps \
${PHPIZE_DEPS} \
gettext-dev \
icu-dev \
imap-dev \
libpng-dev \
libzip-dev \
openldap-dev \
; \
\
# Install PHP extensions
docker-php-ext-configure imap --with-imap-ssl; \
docker-php-ext-install -j "$(nproc)" \
gd \
gettext \
imap \
intl \
ldap \
mysqli \
sockets \
zip \
; \
pecl install apcu; \
docker-php-ext-enable \
apcu \
opcache \
; \
\
# Create msmtp log
touch /var/log/msmtp.log; \
chown www-data:www-data /var/log/msmtp.log; \
\
# Create data dir
mkdir /var/lib/osticket; \
\
# Clean up
apk del .build-deps; \
rm -rf /tmp/pear /var/cache/apk/*
# Download the devinsolutions/docker-osticket repository
RUN set -ex; \
wget -q -O docker-osticket.zip https://github.com/devinsolutions/docker-osticket/archive/refs/heads/master.zip; \
unzip docker-osticket.zip -d /tmp; \
rm docker-osticket.zip
# DO NOT FORGET TO CHECK THE LANGUAGE PACK DOWNLOAD URL BELOW
# DO NOT FORGET TO UPDATE "image-version" FILE
ENV OSTICKET_VERSION=1.18.1 \
OSTICKET_SHA256SUM=0802d63ed0705652d2c142b03a4bdb77a6ddec0832dfbf2748a2be38ded8ffeb
RUN set -ex; \
\
cp /tmp/docker-osticket-master/utils/verify-plugin.php /tmp/verify-plugin.php; \
\
wget -q -O osTicket.zip https://github.com/osTicket/osTicket/releases/download/\
v${OSTICKET_VERSION}/osTicket-v${OSTICKET_VERSION}.zip; \
echo "${OSTICKET_SHA256SUM} osTicket.zip" | sha256sum -c; \
unzip osTicket.zip 'upload/*'; \
rm osTicket.zip; \
mkdir /usr/local/src; \
mv upload /usr/local/src/osticket; \
# Hard link the sources to the public directory
cp -al /usr/local/src/osticket/. /var/www/html; \
# Hide setup
rm -r /var/www/html/setup; \
\
cd /var/www/html; \
\
for lang in bg bn bs ca cs da de el es_AR es_ES es_MX et eu fa fi fr gl he hi hr hu id is it \
ja ka km ko lt lv mk mn ms nl no pl pt_BR pt_PT ro ru sk sl sq sr sr_CS sv_SE sw th tr uk \
ur_IN ur_PK vi zh_CN zh_TW; do \
# This URL is the same as what is used by the official osTicket Downloads page. This URL is \
# used even for minor versions >= 14.
wget -q -O /var/www/html/include/i18n/${lang}.phar \
https://s3.amazonaws.com/downloads.osticket.com/lang/1.14.x/${lang}.phar; \
php /tmp/verify-plugin.php "/var/www/html/include/i18n/${lang}.phar"; \
done
RUN set -ex; \
\
for plugin in audit auth-2fa auth-ldap auth-oauth2 auth-passthru auth-password-policy \
storage-fs storage-s3; do \
wget -q -O /var/www/html/include/plugins/${plugin}.phar \
https://s3.amazonaws.com/downloads.osticket.com/plugin/${plugin}.phar; \
done; \
# This checks .phar integrity (authenticity check is not supported - see \
# https://github.com/osTicket/osTicket/issues/6376).
for phar in /var/www/html/include/plugins/*.phar; do \
# The following PHP code throws an exception and returns non-zero if .phar can't be loaded \
# (e.g. due to a checksum mismatch)
php -r "new Phar(\"${phar}\");"; \
done
ENV OSTICKET_SLACK_VERSION=de1d9a276a64520eea6e6368e609a0f4c4829d96 \
OSTICKET_SLACK_SHA256SUM=8d06500fd5b8a589a5f7103c242160086ca1696a5b93d0e3767119a54059532b
RUN set -ex; \
\
wget -q -O osTicket-slack-plugin.tar.gz https://github.com/devinsolutions/\
osTicket-slack-plugin/archive/${OSTICKET_SLACK_VERSION}.tar.gz; \
echo "${OSTICKET_SLACK_SHA256SUM} osTicket-slack-plugin.tar.gz" | sha256sum -c; \
tar -xzf osTicket-slack-plugin.tar.gz -C /var/www/html/include/plugins --strip-components 1 \
osTicket-slack-plugin-${OSTICKET_SLACK_VERSION}/slack; \
rm osTicket-slack-plugin.tar.gz
# Copy the 'root' directory from the downloaded repository into the container's root directory
RUN cp -a /tmp/docker-osticket-master/root/. /; \
\
# Clean up the temporary files
rm -rf /tmp/docker-osticket-master
CMD ["start"]
STOPSIGNAL SIGTERM
EXPOSE 80
HEALTHCHECK CMD curl -fIsS http://localhost/ || exit 1