forked from iconoeugen/docker-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 1.05 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
FROM centos:7
MAINTAINER The DevOpsLab Project <[email protected]>
LABEL name="DevOpsLab Nginx Reverse Proxy Base Image"
ENV DOL_BASE_DIR /opt/dol
ENV DOL_TMPL_DIR ${DOL_BASE_DIR}/nginx
# First of all we need the Nginx package.
RUN yum -y install epel-release \
&& yum -y install nginx \
&& yum clean all
# Prepare Nginx proxy configuration.
RUN mkdir -p ${DOL_TMPL_DIR}
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/nginx.vh.proxy.conf.in config/nginx.vh.proxy-http.conf.in config/nginx.vh.proxy-https.conf.in ${DOL_TMPL_DIR}/
# Relax permissions for nginx directories
RUN for dir in /etc/nginx/conf.d /etc/nginx/certs /var/lib/nginx /var/run ; do \
mkdir -p ${dir} && chmod -cR g+rwx ${dir} && chgrp -cR root ${dir} ; \
done
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# And not the docker entrypoint script.
COPY entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
EXPOSE 8080 8443
ENTRYPOINT ["/entrypoint.sh"]