-
Notifications
You must be signed in to change notification settings - Fork 70
/
Dockerfile
92 lines (86 loc) · 3.12 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
FROM docker.io/php:8.0-fpm
LABEL maintainer="markus@martialblog.de"
# Install OS dependencies
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
netcat-openbsd \
libldap-common \
libsasl2-modules \
; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Install PHP Plugins and Configure PHP imap plugin
# hadolint ignore=SC2086
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libldap2-dev \
libfreetype6-dev \
libjpeg-dev \
libonig-dev \
zlib1g-dev \
libc-client-dev \
libkrb5-dev \
libpng-dev \
libpq-dev \
libzip-dev \
libtidy-dev \
libsodium-dev \
; \
\
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
docker-php-ext-install -j "$(nproc)" \
exif \
gd \
imap \
ldap \
mbstring \
pdo \
pdo_mysql \
pdo_pgsql \
pgsql \
sodium \
tidy \
zip \
; \
\
# Reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
ARG version="5.6.68+240625"
ARG sha256_checksum="80a27ec67f9a6de5d883d6d6ba59000b79e79549912ea03a88d4da20eed6aa55"
ARG archive_url="https://github.com/LimeSurvey/LimeSurvey/archive/refs/tags/${version}.tar.gz"
ARG USER=www-data
ENV LIMESURVEY_VERSION=$version
# Download, unzip and chmod LimeSurvey from GitHub (defaults to the official LimeSurvey/LimeSurvey repository)
RUN set -ex; \
curl -sSL "${archive_url}" --output /tmp/limesurvey.tar.gz && \
echo "${sha256_checksum} /tmp/limesurvey.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/limesurvey.tar.gz" --strip-components=1 -C /var/www/html/ && \
rm -f "/tmp/limesurvey.tar.gz" && \
chown -R "$USER:$USER" /var/www/html
EXPOSE 9000
WORKDIR /var/www/html
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
USER $USER
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["php-fpm"]