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 \
9
9
&& pip install --upgrade pip awscli==1.11.183 \
10
10
&& apk -v --purge del py-pip
11
11
12
- COPY files/startup.sh files/renew_token.sh /
12
+ COPY files/startup.sh files/renew_token.sh files/health-check.sh /
13
13
COPY files/ecr.ini /etc/supervisor.d/ecr.ini
14
14
COPY files/root /etc/crontabs/root
15
15
@@ -19,5 +19,7 @@ COPY files/ssl.conf /usr/local/openresty/nginx/conf/ssl.conf
19
19
ENV PORT 5000
20
20
RUN chmod a+x /startup.sh /renew_token.sh
21
21
22
+ HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD /health-check.sh
23
+
22
24
ENTRYPOINT ["/startup.sh" ]
23
25
CMD ["/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 {
54
54
add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
55
55
add_header "Access-Control-Allow-Origin" "*" ;
56
56
57
+ # health check
58
+ location /healthz {
59
+ return 200 ;
60
+ }
61
+
57
62
location / {
58
63
set $url UPSTREAM;
59
64
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
61
61
sed -i -e s! SSL_INCLUDE! " $SSL_INCLUDE " ! g $CONFIG
62
62
sed -i -e s! SSL_LISTEN! " $SSL_LISTEN " ! g $CONFIG
63
63
64
+ # Update health-check
65
+ sed -i -e s! PORT! " $PORT " ! g /health-check.sh
66
+
64
67
# setup ~/.aws directory
65
68
AWS_FOLDER=' /root/.aws'
66
69
mkdir -p ${AWS_FOLDER}
You can’t perform that action at this time.
0 commit comments