-
Notifications
You must be signed in to change notification settings - Fork 0
/
uptime-kuma-dockerfile
36 lines (31 loc) · 1.24 KB
/
uptime-kuma-dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM node:14-buster-slim as base
WORKDIR /app
RUN apt update && \
apt --yes --no-install-recommends install git wget python3 python3-pip python3-cryptography python3-six python3-yaml python3-click python3-markdown python3-requests python3-requests-oauthlib \
sqlite3 iputils-ping util-linux dumb-init && \
pip3 --no-cache-dir install apprise==0.9.7 && \
npm install -g npm@latest && \
rm -rf /var/lib/apt/lists/*
FROM base as git
WORKDIR /app
RUN git clone https://github.com/louislam/uptime-kuma.git .
RUN wget https://patch-diff.githubusercontent.com/raw/louislam/uptime-kuma/pull/1092.diff
RUN git apply 1092.diff
FROM git as node
WORKDIR /app
# prevent npm socket timeout err
RUN npm config set fetch-retry-mintimeout 20000
RUN npm config set fetch-retry-maxtimeout 180000
RUN npm ci --production
FROM node as vite
RUN npm install vite
RUN npm install vite-plugin-legacy
FROM vite as build
WORKDIR /app
RUN npx vite build --config ./config/vite.config.js && \
chmod +x /app/extra/entrypoint.sh
EXPOSE 3001
VOLUME ["/app/data"]
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node app/extra/healthcheck.js
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/app/extra/entrypoint.sh"]
CMD ["node", "/app/server/server.js"]