Add new config option. DOCKER_NETWORK_NAME

This commit is contained in:
Patrick Jentsch 2022-10-12 15:32:47 +02:00
parent 399d41dd08
commit 2ead38bbe4
3 changed files with 8 additions and 1 deletions

View File

@ -143,7 +143,7 @@ def _create_cqpserver_container(corpus):
''' ## Name ## '''
name = f'cqpserver_{corpus.id}'
''' ## Network ## '''
network = 'nopaque_default'
network = f'{current_app.config["DOCKER_NETWORK_NAME"]}'
''' ## Volumes ## '''
volumes = []
''' ### Corpus data volume ### '''

View File

@ -11,6 +11,9 @@ load_dotenv(os.path.join(basedir, '.env'))
class Config:
''' Docker '''
DOCKER_NETWORK_NAME = os.environ.get('DOCKER_NETWORK_NAME', 'nopaque_default')
''' APIFairy '''
APIFAIRY_TITLE = 'nopaque'
APIFAIRY_VERSION = '0.0.1'

View File

@ -1,5 +1,9 @@
version: "3.5"
networks:
default:
name: "${DOCKER_NETWORK_NAME:-nopaque_default}"
services:
db:
env_file: db.env