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 ## '''
name = f'cqpserver_{corpus.id}' name = f'cqpserver_{corpus.id}'
''' ## Network ## ''' ''' ## Network ## '''
network = 'nopaque_default' network = f'{current_app.config["DOCKER_NETWORK_NAME"]}'
''' ## Volumes ## ''' ''' ## Volumes ## '''
volumes = [] volumes = []
''' ### Corpus data volume ### ''' ''' ### Corpus data volume ### '''

View File

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

View File

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