-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (52 loc) · 1.96 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Nginx Dockerfile
#
# Written by:
# Baptiste MOINE <[email protected]>
#
# Pull base image (ie, Debian 8).
FROM debian:8
MAINTAINER Baptiste MOINE <[email protected]>
# Non-interactive frontend.
ENV DEBIAN_FRONTEND noninteractive
# Copy sourcelist for APT.
COPY ./files/apt/sources.list /etc/apt/sources.list
# Note: Each RUN instruction will perform a commit of the image.
# Install Nginx and PHP using only one instruction.
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys ABF5BD827BD9BF62 \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
nginx="1.9.0-1~jessie" \
spawn-fcgi \
gettext-base \
php5-fpm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create Nginx and PHP file structure.
RUN rm -rf /usr/share/nginx/html/ \
&& mkdir -p /etc/nginx.default/conf.d/ \
&& mkdir -p /etc/php5/fpm.default/pool.d/ \
&& mkdir -p /usr/share/nginx/log \
&& mkdir -p /usr/share/nginx/static \
&& mkdir -p /usr/share/nginx/webroot \
&& touch /usr/share/nginx/log/access.log \
&& touch /usr/share/nginx/log/error.log \
&& rm /etc/nginx/nginx.conf \
&& rm /etc/php5/fpm/pool.d/www.conf
# Copy default Nginx configuration files using ADD to keep directory structure (issue #15858).
ADD ./files/nginx/conf/ /etc/nginx.default/
# Copy default PHP configuration files using ADD to keep directory structure (issue #15858).
ADD ./files/fpm/conf/ /etc/php5/fpm.default/
# Add default webroot using ADD to keep directory structure (issue #15858).
ADD ./files/nginx/webroot/ /usr/share/nginx/webroot/
# Copy Startup script.
COPY ./files/start.sh /start.sh
RUN chmod u+x /start.sh
# Create volumes.
VOLUME ["/etc/nginx/", "/etc/php5/fpm/", "/usr/share/nginx/", "/var/www/"]
# TCP port that container will listen for connections.
# HTTP and HTTPS.
EXPOSE 80/tcp 443/tcp
# Alternative to: CMD ["nginx", "-g", "daemon off;"]
CMD ["/start.sh"]