From 84955de52cb4c621330d50bac412a1f24d25f7ed Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Tue, 22 Oct 2024 10:44:52 -0500 Subject: [PATCH 1/3] Docker cleanup. --- README.md | 2 +- docker-compose.yml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index ccde77fe..0b8f11a7 100755 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ This builds and starts two containers, one for the API (named `helium_platform_a name, like: ```shell -docker exec -it helium_platform_api /bin/bash +docker exec -it platform-api-1 /bin/bash ``` Inside the `platform` container, you can run Django commands against the app, like: diff --git a/docker-compose.yml b/docker-compose.yml index 5508b1df..c5ce620f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,12 +8,10 @@ services: MYSQL_PASSWORD: "helium" ports: - 3306:3306 - container_name: helium_db cache: image: redis:7.2 ports: - 6379:6379 - container_name: helium_cache storage: image: localstack/localstack:s3-latest environment: @@ -22,7 +20,6 @@ services: - 4566:4566 volumes: - "./container/init-localstack.py:/etc/localstack/init/ready.d/init-localstack.py" - container_name: helium_storage resource: image: helium/platform-resource env_file: .env @@ -30,7 +27,6 @@ services: - type: bind source: ./.env target: /app/.env - container_name: helium_platform_resource depends_on: - db - cache @@ -44,7 +40,6 @@ services: target: /app/.env ports: - 8000:8000 - container_name: helium_platform_api depends_on: - db - cache @@ -58,7 +53,6 @@ services: - type: bind source: ./.env target: /app/.env - container_name: helium_platform_worker depends_on: - db - cache From 202d93cd981dc7167fbe90b8ea2130f67423176b Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Tue, 22 Oct 2024 11:52:02 -0500 Subject: [PATCH 2/3] Add api to ALLOWED_HOSTS when inside a Docker container locally. --- conf/configs/common.py | 2 +- conf/configs/deploy.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/configs/common.py b/conf/configs/common.py index cf691bed..e9cbe327 100644 --- a/conf/configs/common.py +++ b/conf/configs/common.py @@ -34,7 +34,6 @@ PROJECT_APP_HOST = 'http://localhost:3000' PROJECT_API_HOST = 'http://localhost:8000' else: - PROJECT_APP_HOST = config('PROJECT_APP_HOST', f'https://www.{ENVIRONMENT_PREFIX}heliumedu.com') PROJECT_API_HOST = config('PROJECT_API_HOST', f'https://api.{ENVIRONMENT_PREFIX}heliumedu.com') @@ -258,6 +257,7 @@ if 'local' in ENVIRONMENT: ALLOWED_HOSTS += [ + 'api', '.ngrok.io', '.ngrok.app' ] diff --git a/conf/configs/deploy.py b/conf/configs/deploy.py index 2958fa96..43ae4d15 100644 --- a/conf/configs/deploy.py +++ b/conf/configs/deploy.py @@ -64,6 +64,8 @@ print(f"INFO: Added AWS private IP {private_ips} to ALLOWED_HOSTS") except Exception as e: print("INFO: No AWS IPs added to ALLOWED_HOSTS, ignore if not running on AWS") +else: + ALLOWED_HOSTS = common.ALLOWED_HOSTS # Logging From e6eda1b5fac959a0b562389e0516bdf5e1e10975 Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Tue, 22 Oct 2024 14:04:11 -0500 Subject: [PATCH 3/3] Update common.py --- conf/configs/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/configs/common.py b/conf/configs/common.py index e9cbe327..f8877f12 100644 --- a/conf/configs/common.py +++ b/conf/configs/common.py @@ -257,7 +257,6 @@ if 'local' in ENVIRONMENT: ALLOWED_HOSTS += [ - 'api', '.ngrok.io', '.ngrok.app' ]