Add healthcheck to nodeapp

This commit is contained in:
Reckless_Satoshi 2023-03-10 09:02:47 -08:00
parent ef55207812
commit 3ac5e05354
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 10 additions and 7 deletions

View File

@ -8,9 +8,10 @@ COPY ./nginx/local.conf /etc/nginx/conf.d/local.conf
RUN touch ./selfhosted
RUN apt-get update
RUN apt-get install -y socat nginx
RUN apt-get install -y socat nginx curl
RUN npm install http-server
EXPOSE 12596
HEALTHCHECK CMD curl --fail http://localhost:12596/selfhosted || exit 1
CMD ["bash", "robosats-client.sh"]

View File

@ -14,10 +14,6 @@ server {
listen 12596;
server_name robosats_client;
# location /static {
# alias /usr/src/static;
# }
location / {
# requests are passed to npm Http-Server
proxy_pass http://robosats_http_server;
@ -27,8 +23,8 @@ server {
}
# websockets are passed to socat bridge
location /ws/ {
# websockets are passed to socat bridge
proxy_pass http://robosats_websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@ -39,4 +35,10 @@ server {
location = /favicon.ico {
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
}
}
# do not log healtchecks made against "/selfhosted"
location /selfhosted {
access_log off;
return 200 "OK";
}
}