This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/health-check/Dockerfile

25 lines
887 B
Docker
Raw Normal View History

2021-05-13 10:30:35 +00:00
FROM node:16.1.0-alpine
2020-07-30 12:23:49 +00:00
WORKDIR /usr/app
2021-05-24 15:30:29 +00:00
# schedule critical checks to run every 5 minutes (any failures will disable server)
2021-05-24 15:13:29 +00:00
RUN echo '*/5 * * * * /usr/app/cli/run critical > /dev/stdout' >> /etc/crontabs/root
2021-05-24 15:30:29 +00:00
# schedule extended checks to run on every hour (optional checks, report only)
2021-05-24 15:13:29 +00:00
RUN echo '0 * * * * /usr/app/cli/run extended > /dev/stdout' >> /etc/crontabs/root
2020-07-30 12:23:49 +00:00
COPY package.json .
RUN yarn --no-lockfile
2020-09-09 14:08:10 +00:00
COPY src src
COPY cli cli
2020-07-30 12:23:49 +00:00
EXPOSE 3100
ENV NODE_ENV production
2021-05-24 15:30:29 +00:00
# command consists of 3 parts:
# 1. starting crond
# 2. aliasing siasky.net and account.siasky.net with current server ip so health checks
# test portal end-to-end on prod domain (important for testing ssl certificates)
# 3. running api service
CMD [ "sh", "-c", "crond ; echo $(node src/whatismyip.js) siasky.net account.siasky.net >> /etc/hosts ; node --max-http-header-size=64000 src/index.js" ]