diff --git a/compose.yaml b/compose.yaml index bff507e..5fd8b0d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -18,13 +18,14 @@ services: depends_on: - database environment: + SUPERSET_CONFIG_PATH: /app/pythonpath/superset_config.py SUPERSET_SECRET_KEY: ${SUPERSET_SECRET:-!ChangeMe!} SUPERSET_LOAD_EXAMPLES: no - SUPERSET_DATABASE_URI: postgresql+psycopg2://sql:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/superset ports: - "8088:8088" volumes: - superset_home:/app/superset_home + - ./superset_config.py:/app/pythonpath/superset_config.py command: > sh -c " superset db upgrade && @@ -32,8 +33,7 @@ services: superset init && superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger " - + volumes: database_data: superset_home: - \ No newline at end of file diff --git a/docker-entrypoint-initdb.d/1_initdb.sql b/docker-entrypoint-initdb.d/1_initdb.sql index 3d3f4ca..3b753e7 100644 --- a/docker-entrypoint-initdb.d/1_initdb.sql +++ b/docker-entrypoint-initdb.d/1_initdb.sql @@ -63,4 +63,11 @@ create table region ( insert into region values (1, 'Est'), (2, 'Ouest'); -create database superset; \ No newline at end of file +-- Apache Superset +create database superset; +create user superset with password 'supermotdepasse'; +grant all privileges on database superset to superset; + +\c superset +alter schema public owner to superset; +grant all privileges on schema public to superset; diff --git a/superset_config.py b/superset_config.py new file mode 100644 index 0000000..2f0b54e --- /dev/null +++ b/superset_config.py @@ -0,0 +1,2 @@ +SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY' +SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://superset:supermotdepasse@database:5432/superset"