-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache-ubuntu
34 lines (25 loc) · 866 Bytes
/
apache-ubuntu
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
#Use the Ubuntu base image
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
#Update all packages
RUN apt-get update
#Install tzdata and set timezone.
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get -y install tzdata
#Install applications
RUN apt-get -y install apache2
RUN apt-get -y install php libapache2-mod-php
#Remove any unnecessary files
RUN apt-get clean
#Setup Apache2 servers
#Debian configuration requires the environment variables APACHE_RUN_USER, APACHE_RUN_GROUP, and APACHE_PID_FILE to be set
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
#Expose ports
EXPOSE 80
#Start services
CMD /usr/sbin/apache2ctl -D FOREGROUND
#Copy files to webserver
ADD index.php /var/www/html