-
Notifications
You must be signed in to change notification settings - Fork 28
/
centos8-httpd-user.dockerfile
34 lines (28 loc) · 1.01 KB
/
centos8-httpd-user.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
FROM centos:8.1.1911
LABEL __copyright__="(C) Guido Draheim, licensed under the EUPL" \
__version__="1.5.8065"
ARG PORT=8080
EXPOSE $PORT
COPY files/docker/systemctl3.py /usr/bin/systemctl3.py
RUN sed -i -e "s|/usr/bin/python3|/usr/libexec/platform-python|" /usr/bin/systemctl3.py
RUN cp /usr/bin/systemctl3.py /usr/bin/systemctl
RUN yum install -y httpd httpd-tools
RUN cp /usr/bin/systemctl3.py /usr/bin/systemctl
RUN echo TEST_OK > /var/www/html/index.html
RUN sed -i "s|^Listen .*|Listen $PORT|" /etc/httpd/conf/httpd.conf
RUN : \
; mkdir /usr/lib/systemd/system/httpd.service.d \
; { echo "[Service]" ; echo "User=apache"; } \
> /usr/lib/systemd/system/httpd.service.d/usermode.conf
RUN : \
; chown -R apache /etc/httpd \
; chown -R apache /usr/share/httpd \
; chown -R apache /run/httpd \
; : chown -R apache /var/log/httpd \
; rm /etc/httpd/logs \
; mkdir /var/www/logs \
; ln -s /var/www/logs /etc/httpd \
; chown -R apache /var/www
RUN systemctl enable httpd
CMD /usr/bin/systemctl
USER apache