updated behaviour/mount of secrets.py

This commit is contained in:
Hendrik Behme 2019-08-27 14:32:48 +02:00
parent 04faed2f07
commit c54a656390
5 changed files with 19 additions and 3 deletions

10
.gitignore vendored
View File

@ -1,11 +1,15 @@
# IDE Folders # IDE Folders
pm/../.idea/ .idea/
.env
# PY VENV # PY VENV
pm/venv/ pm/venv/
# Tokens and Passwwords # Tokens and Passwwords (information will be fetched from .env)
pm/essentials/secrets.py # secrets.py
pm/pollmaster\.log pm/pollmaster\.log

View File

@ -19,6 +19,8 @@ services:
# App - Container, where the main application runs # App - Container, where the main application runs
app: app:
restart: always restart: always
volumes:
- ./secrets.py:/data/pm/essentials/secrets.py
links: links:
- mongo - mongo
build: build:

10
secrets.py Normal file
View File

@ -0,0 +1,10 @@
import os
class Secrets:
def __init__(self):
self.dbl_token = '' # DBL token (only needed for public bot)
self.mongo_db = ('mongodb://%s:%s@mongo:27017/pollmaster' % (os.environ.get('MONGO_INITDB_ROOT_USERNAME'), os.environ.get('MONGO_INITDB_ROOT_PASSWORD')))
self.bot_token = os.environ.get('DISCORD_BOT_TOKEN') # official discord bot token
self.mode = 'development' # or production
SECRETS = Secrets()