forked from sourcegraph/checkup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deployment: optional support for sqlite
adds optional dockerfile and docker-compose with sqlite support/config. adds make target for alternate build. addresses sourcegraph#140
- Loading branch information
Kevin Ard
committed
Oct 9, 2020
1 parent
77e7567
commit 3cd90aa
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.github | ||
builds | ||
checks | ||
checkup.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: "2.4" | ||
|
||
services: | ||
#-- worker node | ||
worker: | ||
image: checkup:sqlite3 | ||
volumes: | ||
- ./checkup.json:/app/checkup.json | ||
- ./checks:/app/checks | ||
entrypoint: | ||
- checkup | ||
- every | ||
- 10s | ||
user: "1000:1000" | ||
restart: always | ||
|
||
#-- client | ||
checkup: | ||
hostname: checkup | ||
image: checkup:sqlite3 | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- ./checkup.json:/app/checkup.json | ||
- ./checks:/app/checks | ||
- ./statuspage/js/config_sqlite3.js:/app/statuspage/js/config.js | ||
user: "1000:1000" | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#---------------------------- Build | ||
FROM golang:1.14-alpine as builder | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
RUN apk add --no-cache make gcc musl-dev && \ | ||
rm -rf /var/cache/apk/* && \ | ||
make build-sqlite3 | ||
|
||
#---------------------------- Deploy | ||
FROM alpine:3.4 | ||
|
||
RUN apk --update upgrade && \ | ||
apk add --no-cache sqlite ca-certificates && \ | ||
rm -f /usr/bin/sqlite3 && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
RUN mkdir /lib64 && \ | ||
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/builds/checkup /usr/local/bin/checkup | ||
ADD statuspage/ /app/statuspage | ||
|
||
RUN addgroup -g 1000 app | ||
RUN adduser -g "" -G app -D -H -u 1000 app | ||
|
||
USER app | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT ["checkup"] | ||
CMD ["serve"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
checkup.config = { | ||
// How much history to show on the status page. Long durations and | ||
// frequent checks make for slow loading, so be conservative. | ||
// This value is in NANOSECONDS to mirror Go's time package. | ||
"timeframe": 1 * time.Day, | ||
|
||
// How often, in seconds, to pull new checks and update the page. | ||
"refresh_interval": 60, | ||
|
||
// Configure read-only access to stored checks. This configuration | ||
// depends on your storage provider. Any credentials and other values | ||
// here will be visible to everyone, so use keys with ONLY read access! | ||
"storage": { | ||
// Storage type (fs for local, s3 for AWS S3) | ||
"type": "sqlite3", | ||
// Local checkup server by default, set to github page if | ||
// you're hosting your status page on GitHub. | ||
// e.g. "https://sourcegraph.github.io/checkup/checks/" | ||
"url": "/" | ||
}, | ||
|
||
// The text to display along the top bar depending on overall status. | ||
"status_text": { | ||
"healthy": "Situation Normal", | ||
"degraded": "Degraded Service", | ||
"down": "Service Disruption" | ||
} | ||
}; |