diff --git a/app/daemon/corpus_utils.py b/app/daemon/corpus_utils.py index 1703521a..4d807c14 100644 --- a/app/daemon/corpus_utils.py +++ b/app/daemon/corpus_utils.py @@ -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 ### ''' diff --git a/config.py b/config.py index 4eba99d2..97e810ee 100644 --- a/config.py +++ b/config.py @@ -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' diff --git a/docker-compose.yml b/docker-compose.yml index f668e00d..52f011e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,9 @@ version: "3.5" +networks: + default: + name: "${DOCKER_NETWORK_NAME:-nopaque_default}" + services: db: env_file: db.env