Skip to content

Commit

Permalink
General maintenance (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 authored Sep 25, 2024
1 parent d741997 commit 7b06fb4
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 613 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN adduser --disabled-password --gecos "" catherine \

USER catherine

ENV PATH="${PATH}:${HOME}/.local/bin"
ENV PATH="${PATH}:/home/catherine/.local/bin"

RUN pip install --user -r requirements.txt

Expand Down
61 changes: 61 additions & 0 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: catherine

services:
catherine:
container_name: catherine
build:
context: .
dockerfile: Dockerfile
volumes:
# Do not edit the next line. If you want to change the path of the configuration file, please edit the CONFIG_LOCATION variable
- ${CONFIG_LOCATION}:/catherine/bot/config.yml
ports:
- 6789:6789
depends_on:
- database
command: sh -c '/catherine/wait-for database:5432 -- echo "[Wait-for] PostgreSQL is fully up. Starting Catherine-Chan." && /catherine/start.sh'
restart: always

database:
container_name: catherine_postgres
build:
context: ./pg
dockerfile: Dockerfile
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
ports:
- 5432:5432
volumes:
- database:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
restart: always

catherine-prometheus:
container_name: catherine_prometheus
ports:
- 9090:9090
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus

# first login uses admin/admin
# add data source for http://catherine-prometheus:9090 to get started
catherine-grafana:
container_name: catherine_grafana
command: ['./run.sh', '-disable-reporting']
ports:
- 3000:3000
image: grafana/grafana-enterprise:latest-ubuntu
volumes:
- grafana-data:/var/lib/grafana

volumes:
database:
2 changes: 0 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ services:
volumes:
# Do not edit the next line. If you want to change the path of the configuration file, please edit the CONFIG_LOCATION variable
- ${CONFIG_LOCATION}:/catherine/bot/config.yml
env_file:
- .env
ports:
- 6789:6789
depends_on:
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions old_tests/bot/cogs/__init__.py

This file was deleted.

69 changes: 0 additions & 69 deletions old_tests/bot/cogs/embeds.py

This file was deleted.

38 changes: 0 additions & 38 deletions old_tests/bot/conftest.py

This file was deleted.

32 changes: 0 additions & 32 deletions old_tests/cog_utils/test_commons.py

This file was deleted.

96 changes: 0 additions & 96 deletions old_tests/cog_utils/test_dictionary.py

This file was deleted.

61 changes: 0 additions & 61 deletions old_tests/cog_utils/test_hrt.py

This file was deleted.

Loading

0 comments on commit 7b06fb4

Please sign in to comment.