nginx & Dockerfile & entrypoint.sh

  

Dockerfile

 1 # Description: eidolon
 2 
 3 FROM busybox:latest
 4 LABEL maintainer='eidolon '
 5 
 6 ENV     DOC_ROOT=/data/ \
 7         PACKAGE=nginx-1.19.0.tar.gz
 8 
 9 COPY confound ${DOC_ROOT}
10 COPY openldap /openldap/
11 
12 ADD http://nginx.org/download/nginx-1.19.0.tar.gz /usr/local/src/
13 #ADD ${PACKAGE} /usr/local/src/
14 
15 VOLUME /data/mysql/
16 EXPOSE 80/tcp 80/udp
17 
18 RUN     cd /usr/local/src && \
19         tar -xf /usr/local/src/${PACKAGE} && \
20         ln -sv nginx-1.19.0 nginx
21 
22 WORKDIR /etc 

 

 1 FROM nginx:1.14-alpine
 2 LABEL   maitainer='eidolon ' \
 3         app=nginx
 4 
 5 ENV     NGX_DOC_ROOT='/data/html/' \
 6         HOSTNAME='eidolon'
 7 
 8 RUN     mkdir -p ${NGX_DOC_ROOT}
 9 
10 ADD entrypoint.sh /bin/
11 ADD index.html ${NGX_DOC_ROOT}
12 
13 RUN     chmod +x /bin/entrypoint.sh
14 
15 EXPOSE 80/tcp 80/udp
16 
17 STOPSIGNAL SIGTERM
18 
19 HEALTHCHECK --interval=4s --timeout=2s --start-period=3s --retries=2 \
20         CMD wget -O - -q http://${IP:-0.0.0.0}:${PORT:-80} || exit 1
21 
22 CMD ["nginx","-g","daemon off;"]
23 ENTRYPOINT ["entrypoint.sh"]

 

FROM busybox:latest
LABEL maintainer="eidolon " app=httpd

ENV WEB_DOC_ROOT="/data/html/"

RUN     mkdir -p ${WEB_DOC_ROOT} && \
        echo pppppppppppppppppp > ${WEB_DOC_ROOT}index.html

#CMD httpd -f -h ${WEB_DOC_ROOT}
#CMD ["sh","-c","httpd","-f","-h ${WEB_DOC_ROOT}"]
#ENTRYPOINT httpd -f -h ${WEB_DOC_ROOT}
#ENTRYPOINT ["sh","-c","httpd","-f","-h","/data/html"]

#CMD ["-f","-h","/data/html"]
#ENTRYPOINT ["httpd"]

#CMD ["/bin/httpd","-f","-h","/data/html"]
#ENTRYPOINT ["/bin/sh","-c"]

CMD ["zz","xxx"]
ENTRYPOINT ["echo","pppppp"]

 

entrypoint.sh

 1 #!/bin/sh
 2 
 3 cat > /etc/nginx/conf.d/www.conf <<-eof
 4 server {
 5         server_name ${HOSTNAME:-zxc};
 6         listen ${IP:-0.0.0.0}:${PORT:-80};
 7         root ${NGX_DOC_ROOT:-/usr/share/nginx/html};
 8 }
 9 eof
10 
11 cat >> /etc/hosts <<-eof
12 127.0.0.1 ${HOSTNAME}
13 eof
14 
15 echo ${HOSTNAME} > /etc/hostname
16 
17 exec "$@"

 

你可能感兴趣的:(nginx & Dockerfile & entrypoint.sh)