-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (59 loc) · 1.78 KB
/
Dockerfile
File metadata and controls
73 lines (59 loc) · 1.78 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
##############################################
# Dockerfile to build Apache HTTP server image
##############################################
# Base image
FROM ubuntu:16.04
# Author: MobileSnapp Inc.
MAINTAINER MobileSnapp <support@mobilesnapp.com>
# Install Apache HTTP server
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y \
apache2 \
curl && \
apt-get clean \
&& rm -r /var/lib/apt/lists/*
# Install PHP and helper packages
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y \
php7.0 \
libapache2-mod-php7.0 \
php7.0-mysql \
php7.0-curl \
php7.0-json \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
# Assign working directory
WORKDIR /var/www/site/
# Expose web and SSL ports.
EXPOSE 80
EXPOSE 443
# Update the default apache site with the config we created.
ADD apache-config.conf /etc/apache2/sites-available/000-default.conf
# Resolving host
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Enable site
RUN a2ensite 000-default
ADD dir.conf /etc/apache2/mods-enabled/dir.conf
# Activate mod_rewrites
RUN a2enmod rewrite
# Restart server
RUN service apache2 restart
RUN apt-get update && apt-get install -y \
libpq-dev \
libmemcached-dev \
curl \
libpng12-dev \
libfreetype6-dev \
libssl-dev \
libmcrypt-dev \
--no-install-recommends \
&& rm -r /var/lib/apt/lists/*
# By default start up apache in the foreground, override with /bin/bash for interative.
CMD /usr/sbin/apache2ctl -D FOREGROUND