From 2d66b0a200e077cc8659cb6bf8588fa2a0fe32e6 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Tue, 29 Aug 2023 19:24:26 +0100 Subject: [PATCH] update docker hostnames to avoid conflicts when sharing network --- docker-compose.example.yml | 3 +++ populater/src/app.py | 2 +- web/src/app.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) mode change 100755 => 100644 populater/src/app.py diff --git a/docker-compose.example.yml b/docker-compose.example.yml index 9268a9e..e217ac5 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -2,6 +2,7 @@ version: '3.9' services: web: + hostname: heartbeats-web build: context: . dockerfile: ./web/Dockerfile @@ -14,12 +15,14 @@ services: - BASE_URL=http://localhost:8464 redis: + hostname: heartbeats-redis image: redis restart: unless-stopped volumes: - './redis-data:/data' populater: + hostname: heartbeats-populater build: context: . dockerfile: ./populater/Dockerfile diff --git a/populater/src/app.py b/populater/src/app.py old mode 100755 new mode 100644 index 5427486..ceb0604 --- a/populater/src/app.py +++ b/populater/src/app.py @@ -16,7 +16,7 @@ CLIENT_SECRET = os.environ.get('CLIENT_SECRET', None) if CLIENT_SECRET is None: raise ValueError("CLIENT_SECRET cannot be None, set using environment variable") -db = Db('redis', 6379, 0, CLIENT_ID, CLIENT_SECRET) +db = Db('heartbets-redis', 6379, 0, CLIENT_ID, CLIENT_SECRET) def get_args(): diff --git a/web/src/app.py b/web/src/app.py index 2405a9c..74ba156 100644 --- a/web/src/app.py +++ b/web/src/app.py @@ -28,7 +28,7 @@ BASE_URL = os.environ.get('BASE_URL', None) if BASE_URL is None: raise ValueError("BASE_URL cannot be None, set using environtment variable") -db = Db('redis', 6379, 0, CLIENT_ID, CLIENT_SECRET) +db = Db('heartbeats-redis', 6379, 0, CLIENT_ID, CLIENT_SECRET) SPOTIFY_AUTHORIZE_ENDPOINT = os.environ.get('SPOTIFY_AUTHORIZE_ENDPOINT', 'https://accounts.spotify.com/authorize?') SPOTIFY_TOKEN_ENDPOINT = os.environ.get('SPOTIFY_AUTHORIZE_ENDPOINT', 'https://accounts.spotify.com/api/token')