Commit 30a0df38 authored by daidekun's avatar daidekun
parents 369864da 13051ec8
FROM nginx
MAINTAINER kalvin "dekun.dai@quantgroup.cn"
COPY auto-reload-nginx.sh /home/auto-reload-nginx.sh
RUN chmod +x /home/auto-reload-nginx.sh
# #替换源
WORKDIR /etc/apt/
RUN mv sources.list /tmp
......@@ -22,8 +26,10 @@ RUN apt-get update \
git \
rlwrap \
vim \
inotify-tools \
&& curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install --assume-yes --no-install-recommends nodejs \
&& apt-get clean
CMD nginx -g 'daemon off;'
\ No newline at end of file
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
#!/bin/sh
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
nginx "$@"
oldcksum=`cksum /etc/nginx/conf.d/default.conf`
inotifywait -e modify,move,create,delete -mr --timefmt '%d/%m/%y %H:%M' --format '%T' \
/etc/nginx/conf.d/ | while read date time; do
newcksum=`cksum /etc/nginx/conf.d/default.conf`
if [ "$newcksum" != "$oldcksum" ]; then
echo "At ${time} on ${date}, config file update detected."
oldcksum=$newcksum
nginx -s reload
fi
done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment