Skip to content

Commit

Permalink
Merge ba761d6 into e6ea46a
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Sep 17, 2021
2 parents e6ea46a + ba761d6 commit ba7e1c5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -116,6 +116,7 @@ log.*
# Custom user configuration
config.yml
docker-compose.override.yml
metricity-config.toml

# xmlrunner unittest XML reports
TEST-**.xml
Expand Down
2 changes: 1 addition & 1 deletion bot/bot.py
Expand Up @@ -109,7 +109,7 @@ async def ping_services(self) -> None:
def create(cls) -> "Bot":
"""Create and return an instance of a Bot."""
loop = asyncio.get_event_loop()
allowed_roles = [discord.Object(id_) for id_ in constants.MODERATION_ROLES]
allowed_roles = list({discord.Object(id_) for id_ in constants.MODERATION_ROLES})

intents = discord.Intents.all()
intents.presences = False
Expand Down
22 changes: 21 additions & 1 deletion docker-compose.yml
Expand Up @@ -23,6 +23,11 @@ services:
POSTGRES_DB: pysite
POSTGRES_PASSWORD: pysite
POSTGRES_USER: pysite
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pysite"]
interval: 2s
timeout: 1s
retries: 5

redis:
<< : *logging
Expand All @@ -31,6 +36,21 @@ services:
ports:
- "127.0.0.1:6379:6379"

metricity:
<< : *logging
restart: on-failure # USE_METRICITY=false will stop the container, so this ensures it only restarts on error
depends_on:
postgres:
condition: service_healthy
image: ghcr.io/python-discord/metricity:latest
env_file:
- .env
environment:
DATABASE_URI: postgres://pysite:pysite@postgres/metricity
USE_METRICITY: ${USE_METRICITY-false}
volumes:
- .:/tmp/bot:ro

snekbox:
<< : *logging
<< : *restart_policy
Expand All @@ -56,7 +76,7 @@ services:
- "127.0.0.1:8000:8000"
tty: true
depends_on:
- postgres
- metricity
environment:
DATABASE_URL: postgres://pysite:pysite@postgres:5432/pysite
METRICITY_DB_URL: postgres://pysite:pysite@postgres:5432/metricity
Expand Down

0 comments on commit ba7e1c5

Please sign in to comment.