-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (31 loc) · 1.12 KB
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
FROM alpine:3.18
# Systemabhängigkeiten, PHP 8.2 und Apache installieren
RUN apk add --no-cache \
curl \
apache2 \
php82 \
php82-apache2 \
php82-curl \
php82-json \
php82-openssl \
php82-mbstring \
php82-phar \
php82-dom \
php82-xml \
php82-xmlwriter \
php82-ctype \
&& mkdir -p /run/apache2
# App-Ordner strukturieren
WORKDIR /var/www/html
# Dateien in den Container spiegeln
COPY . /var/www/html
# Apache-Konfiguration anpassen: DocumentRoot auf /public setzen, Module laden und ServerName-Warnung fixen
RUN sed -i 's|"/var/www/localhost/htdocs"|"/var/www/html/public"|g' /etc/apache2/httpd.conf \
&& sed -i 's|AllowOverride None|AllowOverride All|g' /etc/apache2/httpd.conf \
&& sed -i 's|#LoadModule rewrite_module|LoadModule rewrite_module|g' /etc/apache2/httpd.conf \
&& echo "ServerName localhost" >> /etc/apache2/httpd.conf
# Schreibrechte für den Lazy Cache an den Alpine Apache-User übergeben
RUN mkdir -p /var/www/html/storage && chown -R apache:apache /var/www/html/storage
EXPOSE 80
# Apache im Vordergrund starten
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]