File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ RUN apk add -v --no-cache bind-tools python py-pip supervisor \
99 && pip install --upgrade pip awscli==1.11.183 \
1010 && apk -v --purge del py-pip
1111
12- COPY files/startup.sh files/renew_token.sh /
12+ COPY files/startup.sh files/renew_token.sh files/health-check.sh /
1313COPY files/ecr.ini /etc/supervisor.d/ecr.ini
1414COPY files/root /etc/crontabs/root
1515
@@ -19,5 +19,7 @@ COPY files/ssl.conf /usr/local/openresty/nginx/conf/ssl.conf
1919ENV PORT 5000
2020RUN chmod a+x /startup.sh /renew_token.sh
2121
22+ HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD /health-check.sh
23+
2224ENTRYPOINT ["/startup.sh" ]
2325CMD ["/usr/bin/supervisord" , "-c" , "/etc/supervisord.conf" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ wget localhost:PORT/healthz -q -O - > /dev/null 2>&1
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ http {
5454 add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
5555 add_header "Access-Control-Allow-Origin" "*" ;
5656
57+ # health check
58+ location /healthz {
59+ return 200 ;
60+ }
61+
5762 location / {
5863 set $url UPSTREAM;
5964 proxy_pass $url ;
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ sed -i -e s!SCHEME!"$SCHEME"!g $CONFIG
6161sed -i -e s! SSL_INCLUDE! " $SSL_INCLUDE " ! g $CONFIG
6262sed -i -e s! SSL_LISTEN! " $SSL_LISTEN " ! g $CONFIG
6363
64+ # Update health-check
65+ sed -i -e s! PORT! " $PORT " ! g /health-check.sh
66+
6467# setup ~/.aws directory
6568AWS_FOLDER=' /root/.aws'
6669mkdir -p ${AWS_FOLDER}
You can’t perform that action at this time.
0 commit comments