-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
42 lines (22 loc) · 816 Bytes
/
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
#Baseimage-Information
FROM docker.io/centos
#Maintainer Information
MAINTAINER Vatsal Thakor
#Install required rpm's
RUN yum install vim net-tools httpd iproute php -y
#Copy source code (index.html)
COPY . /var/www/html/
#Provide necessary permission
RUN chmod 644 /var/www/html/index.html
#Expose port on which application listen
EXPOSE 8080
LABEL io.openshift.expose-services="8080:http"
#Change the port number in the Apache HTTP Server configuration file
RUN sed -i "s/Listen 80/Listen 8080/g" /etc/httpd/conf/httpd.conf
#Change the group ID and permissions
RUN chgrp -R 0 /var/log/httpd /var/run/httpd && \
chmod -R g=u /var/log/httpd /var/run/httpd
#Add a USER instruction for an unprivileged user.
USER 1001
#Start apache in background
ENTRYPOINT ["/usr/sbin/httpd", "-D", "FOREGROUND"]