From 8cb5142f87b985483a0fdca9aee6f5cbce350c35 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:35:10 -0300 Subject: [PATCH] fix: docker-compose non-dev (#25055) (cherry picked from commit 7317d9c0b2f0782b161a19c9faf95fd4d8634619) --- docker-compose-non-dev.yml | 11 ++++++++--- docker/.env-non-dev | 10 ++++++++-- docker/pythonpath_dev/superset_config.py | 24 ++++++++++++------------ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/docker-compose-non-dev.yml b/docker-compose-non-dev.yml index 0ce96e00bafd2..785472e7c6a1c 100644 --- a/docker-compose-non-dev.yml +++ b/docker-compose-non-dev.yml @@ -18,8 +18,8 @@ x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset x-superset-depends-on: &superset-depends-on - db - redis -x-superset-volumes: &superset-volumes - # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container +x-superset-volumes: + &superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container - ./docker:/app/docker - superset_home:/app/superset_home @@ -39,6 +39,7 @@ services: restart: unless-stopped volumes: - db_home:/var/lib/postgresql/data + - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d superset: env_file: docker/.env-non-dev @@ -73,7 +74,11 @@ services: user: "root" volumes: *superset-volumes healthcheck: - test: ["CMD-SHELL", "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME"] + test: + [ + "CMD-SHELL", + "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME", + ] superset-worker-beat: image: *superset-image diff --git a/docker/.env-non-dev b/docker/.env-non-dev index 1d071af6a2ff7..a86ddbd193f02 100644 --- a/docker/.env-non-dev +++ b/docker/.env-non-dev @@ -21,11 +21,17 @@ DATABASE_DB=superset DATABASE_HOST=db DATABASE_PASSWORD=superset DATABASE_USER=superset +DATABASE_PORT=5432 +DATABASE_DIALECT=postgresql + +EXAMPLES_DB=examples +EXAMPLES_HOST=db +EXAMPLES_USER=examples +EXAMPLES_PASSWORD=examples +EXAMPLES_PORT=5432 # database engine specific environment variables # change the below if you prefer another database engine -DATABASE_PORT=5432 -DATABASE_DIALECT=postgresql POSTGRES_DB=superset POSTGRES_USER=superset POSTGRES_PASSWORD=superset diff --git a/docker/pythonpath_dev/superset_config.py b/docker/pythonpath_dev/superset_config.py index c2176e03883df..794f7c910fc90 100644 --- a/docker/pythonpath_dev/superset_config.py +++ b/docker/pythonpath_dev/superset_config.py @@ -28,18 +28,18 @@ logger = logging.getLogger() -DATABASE_DIALECT = os.getenv("DATABASE_DIALECT", "postgresql") -DATABASE_USER = os.getenv("DATABASE_USER", "superset") -DATABASE_PASSWORD = os.getenv("DATABASE_PASSWORD", "superset") -DATABASE_HOST = os.getenv("DATABASE_HOST", "db") -DATABASE_PORT = os.getenv("DATABASE_PORT", "5432") -DATABASE_DB = os.getenv("DATABASE_DB", "superset") - -EXAMPLES_USER = os.getenv("EXAMPLES_USER", "examples") -EXAMPLES_PASSWORD = os.getenv("EXAMPLES_PASSWORD", "examples") -EXAMPLES_HOST = os.getenv("EXAMPLES_HOST", "db") -EXAMPLES_PORT = os.getenv("EXAMPLES_PORT", "5432") -EXAMPLES_DB = os.getenv("EXAMPLES_DB", "examples") +DATABASE_DIALECT = os.getenv("DATABASE_DIALECT") +DATABASE_USER = os.getenv("DATABASE_USER") +DATABASE_PASSWORD = os.getenv("DATABASE_PASSWORD") +DATABASE_HOST = os.getenv("DATABASE_HOST") +DATABASE_PORT = os.getenv("DATABASE_PORT") +DATABASE_DB = os.getenv("DATABASE_DB") + +EXAMPLES_USER = os.getenv("EXAMPLES_USER") +EXAMPLES_PASSWORD = os.getenv("EXAMPLES_PASSWORD") +EXAMPLES_HOST = os.getenv("EXAMPLES_HOST") +EXAMPLES_PORT = os.getenv("EXAMPLES_PORT") +EXAMPLES_DB = os.getenv("EXAMPLES_DB") # The SQLAlchemy connection string. SQLALCHEMY_DATABASE_URI = (