first code release: apache with two different base images

This commit is contained in:
bisco 2023-11-05 18:37:27 +01:00
parent 2ce3c378f1
commit 07b0a9f5c1
4 changed files with 46 additions and 0 deletions

14
webserver/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM debian:12-slim
RUN apt update
RUN apt install apache2 -y
COPY index.html /var/www/html
EXPOSE 80
RUN mkdir -p /var/run/apache2 &&\
chown www-data:www-data /var/run/apache2
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_SERVER_NAME localhost
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]

View File

@ -0,0 +1,12 @@
FROM fedora:38
RUN dnf install httpd -y
COPY index.html.fedora /var/www/html/index.html
RUN mkdir -p /var/run/httpd &&\
chown apache:apache /var/run/httpd
ENV APACHE_RUN_DIR /var/run/httpd
ENV APACHE_PID_FILE /var/run/httpd.pid
ENV APACHE_RUN_USER apache
ENV APACHE_RUN_GROUP apache
ENV APACHE_LOG_DIR /var/log/httpd
ENV APACHE_SERVER_NAME localhost
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]

10
webserver/index.html Normal file
View File

@ -0,0 +1,10 @@
<html>
<head>
<title>
This is a test index page
</title>
</head>
<body>
<h2>This is an Apache2 running on a debian 12-slim container</h2>
</body>
</html>

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>
This is a test index page
</title>
</head>
<body>
<h2>This is an Apache2 instance running on a Fedora 38 container</h2>
</body>
</html>