forked from Leo1003/container-images
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (43 loc) · 1.37 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
FROM alpine:3.19
# Argument for the app version
ARG APP_VERSION
# Install required packages
RUN set -ex; \
apk add --no-cache \
apache2 \
curl \
shadow \
util-linux \
php81 \
php81-apache2 \
php81-ldap \
php81-gettext \
php81-mbstring \
php81-opcache \
php81-openssl \
php81-session \
php81-xml \
php81-pecl-apcu; \
\
rm -f /etc/apache2/conf.d/info.conf /etc/apache2/conf.d/userdir.conf; \
ln -sf /usr/bin/php81 /usr/bin/php; \
sed -i -e 's|^#\(LoadModule remoteip_module.*\)|\1|' /etc/apache2/httpd.conf
# Copy configuration files
COPY php.conf.d/ /etc/php81/conf.d/
COPY apache2.conf.d/ /etc/apache2/conf.d/
# Download, extract, and install phpLDAPadmin
RUN set -ex; \
curl -fsSL -o "phpLDAPadmin-${APP_VERSION}.tar.gz" \
"https://github.com/leenooks/phpLDAPadmin/archive/${APP_VERSION}.tar.gz"; \
mkdir -p /var/www/phpldapadmin; \
tar -xzf "phpLDAPadmin-${APP_VERSION}.tar.gz" --strip-components=1 -C /var/www/phpldapadmin; \
rm "phpLDAPadmin-${APP_VERSION}.tar.gz"
# Copy entrypoint script
COPY entrypoint.sh /
# Set execute permission on entrypoint.sh
RUN chmod +x /entrypoint.sh
# Signal for proper container stop handling
STOPSIGNAL SIGWINCH
# Set entrypoint and start Apache
ENTRYPOINT ["/entrypoint.sh"]
CMD ["httpd", "-DFOREGROUND"]