-
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.
- Loading branch information
1 parent
4aa4f0b
commit 5ea17e7
Showing
4 changed files
with
79 additions
and
1 deletion.
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,21 @@ | ||
# DOCKER IMAGE | ||
MONITOR_DOCKER_IMAGE_VERSION="v0.0.1" | ||
|
||
# | ||
# DO S3 ACCESS | ||
# | ||
S3_ACCESS_KEY_ID="<KEY_ID>" | ||
S3_SECRET_ACCESS_KEY="<SECRET KEY>" | ||
S3_BUCKET="jemo" | ||
S3_ENDPOINT="https://sgp1.digitaloceanspaces.com" | ||
# S3_PREFIX="wiki/testing" | ||
S3_PREFIX="wiki/production" | ||
|
||
|
||
# NOTIFICATION CHANNEL | ||
DISCORD_NOTIFICATION_URL="<DISCORD NOTIFICATION URL>" | ||
|
||
# | ||
# CRON FREQ | ||
# CHECK EVERY 45 MINUTES | ||
CRON_MONITOR_TIME="*/45 * * * *" |
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,23 @@ | ||
= Tamil Wiki Backup Monitoring | ||
|
||
Tamil wiki database and images are backed up every hour through a cron job. Daily, weekly, monthly backups are also maintained. There has been instances where the backup failed to run. This monitor is to check s3 for the latest backups uploaded and alert if the houly backup is delayed for more than 1.5 hours. | ||
|
||
== Build | ||
|
||
``` | ||
docker build -t tamilwiki/monitor:v0.0.1 . | ||
``` | ||
|
||
This will build the docker image, with tag `v0.0.1`. This version should be used within the `.env` file, as the value for `MONITOR_DOCKER_IMAGE_VERSION`. | ||
|
||
== Run | ||
|
||
1. Update the `.env.example` with the right values | ||
2. Rename `.env.example` to `.env` within the `monitor` folder | ||
3. Do not mutate the `.env` file in any other folder, especially if you have `compose-deployment` | ||
4. Start the container from `monitor` folder | ||
|
||
``` | ||
docker-compose up -d | ||
``` | ||
|
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,34 @@ | ||
version: '2.4' | ||
|
||
networks: | ||
# This networks defined in main yaml docker-compose.yml file | ||
# Since both are refering common project the network defined here will refer the same. | ||
default: | ||
ipam: | ||
driver: default | ||
|
||
# YAML aliases | ||
x-default: &default | ||
dns: | ||
- 1.1.1.1 | ||
- 1.0.0.1 | ||
|
||
services: | ||
|
||
monitor: | ||
<<: *default | ||
image: tamilwiki/monitor:${MONITOR_DOCKER_IMAGE_VERSION} | ||
restart: on-failure | ||
mem_limit: 128M | ||
mem_reservation: 64M | ||
environment: | ||
DISCORD_NOTIFICATION_URL: ${DISCORD_NOTIFICATION_URL} | ||
CRON_MONITOR_TIME: ${CRON_MONITOR_TIME} | ||
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID} | ||
S3_BUCKET: ${S3_BUCKET} | ||
S3_ENDPOINT: ${S3_ENDPOINT} | ||
S3_LIFECYCLE_EXPIRATION_DAYS: ${S3_LIFECYCLE_EXPIRATION_DAYS} | ||
S3_PREFIX: ${S3_PREFIX} | ||
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY} | ||
networks: | ||
- default |