From 25cb9601985e3a13af1c6ccdf4eaa86359890831 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Fri, 6 Sep 2019 13:42:47 +0200
Subject: [PATCH] Rename services in compose.
---
config.py | 4 ++--
docker-compose.yml | 18 +++++++-----------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/config.py b/config.py
index ed0dadbf..c934b989 100644
--- a/config.py
+++ b/config.py
@@ -30,7 +30,7 @@ class DevelopmentConfig(Config):
DEBUG = True
''' ### Flask-SQLAlchemy ### '''
- SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@opaque_database/{}'.format(
+ SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@db/{}'.format(
os.environ.get('POSTGRES_USER'),
os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME')
@@ -50,7 +50,7 @@ class TestingConfig(Config):
class ProductionConfig(Config):
''' ### Flask-SQLAlchemy ### '''
- SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@opaque_database/{}'.format(
+ SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@db/{}'.format(
os.environ.get('POSTGRES_USER'),
os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME')
diff --git a/docker-compose.yml b/docker-compose.yml
index 8b6ff04d..c8047c98 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,11 +1,10 @@
version: '3'
services:
- opaque:
- container_name: opaque
+ web:
depends_on:
- - opaque_database
- - opaque_redis
+ - db
+ - redis
env_file:
- opaque_database.env
- opaque.env
@@ -15,23 +14,20 @@ services:
restart: always
volumes:
- /opaque_storage:/opaque_storage
- opaque_daemon:
- container_name: opaque_daemon
+ daemon:
depends_on:
- - opaque_database
+ - db
env_file: opaque_database.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
restart: always
volumes:
- $HOME/.docker/config.json:/home/opaque_daemon/.docker/config.json
- opaque_database:
- container_name: opaque_database
+ db:
env_file: opaque_database.env
image: postgres:alpine
restart: always
volumes:
- /opaque_database:/var/lib/postgresql/data
- opaque_redis:
- container_name: opaque_redis
+ redis:
image: redis:alpine
restart: always