File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from enum import Enum
44
55from dotenv import load_dotenv
6+ from redis .asyncio import Redis as _Redis
67
78load_dotenv ()
89
1213MONGO_DATABASE = os .getenv ("MONGO_DATABASE" , "pydis_forms" )
1314SNEKBOX_URL = os .getenv ("SNEKBOX_URL" , "http://snekbox.default.svc.cluster.local/eval" )
1415
16+ REDIS_CLIENT = _Redis .from_url (os .getenv ("REDIS_URL" ), encoding = "utf-8" )
17+
1518PRODUCTION = os .getenv ("PRODUCTION" , "True" ).lower () != "false"
1619PRODUCTION_URL = "https://forms.pythondiscord.com"
1720
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ services:
1515 - " 127.0.0.1:8060:8060"
1616 privileged : true
1717
18+ redis :
19+ image : redis:latest
20+ ports :
21+ - " 127.0.0.1:6379:6379"
22+
1823 backend :
1924 build :
2025 context : .
@@ -25,6 +30,7 @@ services:
2530 depends_on :
2631 - mongo
2732 - snekbox
33+ - redis
2834 tty : true
2935 env_file :
3036 - .env
@@ -38,3 +44,4 @@ services:
3844 - ALLOWED_URL
3945 - DEBUG=true
4046 - PRODUCTION=false
47+ - REDIS_URL=redis://redis:6379
You can’t perform that action at this time.
0 commit comments