-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (36 loc) · 899 Bytes
/
Dockerfile
File metadata and controls
42 lines (36 loc) · 899 Bytes
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
FROM debian:12
# Install packages
RUN apt-get update && apt-get install -y \
apache2 \
apache2-utils \
libapache2-mod-php \
php8.2 \
php8.2-curl \
php8.2-dba \
php8.2-ldap \
php8.2-mongodb \
php8.2-mysql \
php8.2-pdo \
php8.2-odbc \
php8.2-snmp \
php8.2-sqlite3 \
php8.2-xsl \
perl \
libapache2-mod-perl2 \
libapache2-mod-wsgi-py3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Enable apache2 modules
RUN a2enmod cgi userdir rewrite php8.2 wsgi
# Enable PHP extensions for MySQL/PDO
RUN phpenmod -s apache2 pdo pdo_mysql mysqli mysqlnd
# Add the user
ARG USERNAME=devuser
RUN useradd -m -s /bin/bash $USERNAME
RUN rm -rf /home/$USERNAME
# Configs, port and volume
COPY apache2-conf/ /etc/apache2/
EXPOSE 80
VOLUME ["/home/$USERNAME"]
# Run Apache in foreground
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]