prepare for docker

This commit is contained in:
LouisLam 2021-07-11 14:20:31 +08:00
parent 5f89940ab6
commit ae07cd9c35
6 changed files with 32 additions and 7 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
/.idea
/dist
/node_modules
/data/kuma.db

View file

@ -1,5 +1,7 @@
# Uptime Kuma # Uptime Kuma
It is a self-hosted monitoring tool like "Uptime Robot".
# Features # Features
* Monitoring uptime for HTTP(s) / TCP / Ping. * Monitoring uptime for HTTP(s) / TCP / Ping.
@ -17,7 +19,7 @@ One-click Deploy to DigitalOcean
# Motivation # Motivation
* I was looking for a self-hosted monitoring tool like "Uptime Robot", but it is hard to find a suitable one. * I was looking for a self-hosted monitoring tool like "Uptime Robot", but it is hard to find a suitable one. One of the close one is statping. Unfortunately, it is not stable and unmaintained.
* Want to build a fancy UI. * Want to build a fancy UI.
* Learn Vue 3 and vite.js. * Learn Vue 3 and vite.js.
* Show the power of Bootstrap 5. * Show the power of Bootstrap 5.

10
dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM node:14
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
EXPOSE 3001
VOLUME ["/app/data"]
CMD ["npm", "run", "start-server"]

View file

@ -29,7 +29,14 @@ export default {
}, },
created() { created() {
socket = io(":3001", { let wsHost;
if (localStorage.dev === "dev") {
wsHost = ":3001"
} else {
wsHost = ""
}
socket = io(wsHost, {
transports: ['websocket'] transports: ['websocket']
}); });

View file

@ -27,10 +27,11 @@
<input type="url" class="form-control" id="url" v-model="monitor.url" pattern="https?://.+" required> <input type="url" class="form-control" id="url" v-model="monitor.url" pattern="https?://.+" required>
</div> </div>
<div class="mb-3" v-if="monitor.type === 'keyword' "> <div class="mb-3" v-if="monitor.type === 'keyword' ">
<label for="keyword" class="form-label">Keyword <span style="color: #AAA">(search keyword in plain html response)</span></label> <label for="keyword" class="form-label">Keyword</label>
<input type="text" class="form-control" id="keyword" v-model="monitor.keyword" required> <input type="text" class="form-control" id="keyword" v-model="monitor.keyword" required>
</div> <div class="form-text">Search keyword in plain html response and it is case-sensitive</div>
</div>
<div class="mb-3" v-if="monitor.type === 'port' || monitor.type === 'ping' "> <div class="mb-3" v-if="monitor.type === 'port' || monitor.type === 'ping' ">
<label for="hostname" class="form-label">Hostname</label> <label for="hostname" class="form-label">Hostname</label>

View file

@ -53,6 +53,7 @@
<div class="col-md-6"> <div class="col-md-6">
<h2>Notifications</h2> <h2>Notifications</h2>
<p v-if="$root.notificationList.length === 0">Not available, please setup.</p> <p v-if="$root.notificationList.length === 0">Not available, please setup.</p>
<p v-else>Please assign the notification to monitor(s) to get it works.</p>
<ul class="list-group mb-3" style="border-radius: 1rem;"> <ul class="list-group mb-3" style="border-radius: 1rem;">
<li class="list-group-item" v-for="notification in $root.notificationList"> <li class="list-group-item" v-for="notification in $root.notificationList">