-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 1.19 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
# Author: Cuong Tran
# Date: 2017-02-04
#
# Build:
# docker build -t cuongtransc/nginx:1.10.3 .
#
# Run:
# docker run -d -p 80:80 -p 443:443 --name nginx cuongtransc/nginx:1.10.3
#
FROM ubuntu:16.04
MAINTAINER Cuong Tran "cuongtransc@gmail.com"
# Using apt-cacher-ng proxy for caching deb package
RUN echo 'Acquire::http::Proxy "http://172.17.0.1:3142/";' >> /etc/apt/apt.conf.d/01proxy
ENV REFRESHED_AT 2017-02-17
RUN apt-get update -qq
COPY build-nginx/build-nginx-ubuntu-16.04_cached.sh /build-nginx.sh
RUN DEBIAN_FRONTEND=noninteractive bash /build-nginx.sh \
&& rm /build-nginx.sh
RUN apt-get install -y letsencrypt
# Make utf-8 enabled by default
ENV LANG en_US.utf8
COPY nginx-config /etc/nginx
# Remove deb proxy
RUN rm /etc/apt/apt.conf.d/01proxy
# Forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
COPY ./docker-entrypoint.sh /
RUN chmod 755 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# Define working directory
WORKDIR /etc/nginx
# Create mount point
VOLUME ["/etc/nginx", "/etc/letsencrypt"]
# Expose port
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]