Add files.

This commit is contained in:
Elijah Hopp
2024-01-31 21:04:20 +00:00
parent 929f7a1a84
commit bff9628dea
5 changed files with 80 additions and 1 deletions

View File

@@ -1,2 +1,27 @@
# simple-superset-compose # simple-superset-compose
A super-minimal Docker Compose template for Apache Superset.
This is a minimal [Superset](https://superset.apache.org/) + Docker Compose set up. It's intended to simplify the process of trying out Superset.
:warning: This is not intended for production use. There are unsafe defaults enabled in `superset/superset_config.py`.
## Usage
1. Determine if you need to make any changes to `superset_config.py` (more info [here](https://superset.apache.org/docs/installation/configuring-superset)). If you ever make any changes to `superset_config.py`, make sure to rebuild the docker images (`docker compose build`).
2. Run `docker compose up`.
3. Run the `setup.sh` file, which initializes an account named `admin` with the password `secret`.
4. Visit [https://localhost:8080](https://localhost:8080).
5. [Connect the running PostgreSQL to Superset](https://superset.apache.org/docs/databases/db-connection-ui), if necessary.
6. Insert data into the database via the exposed port (`5000` by default), or [via the Superset UI](https://superset.apache.org/docs/creating-charts-dashboards/exploring-data/).
7. Try Superset.
8. Profit!
## Notes
Apache Superset comes with a default Docker Compose setup, but it is not very condusive to trying out the basic functionality of Superset in your local env. This little compose file is the (impercise, quick-n-dirty) product of me wanting to trying out Superset, but shying away from the intensive setup process. It's simple nature lends itself well to use as a little offline anylitics app/SQL exploration lab with fancy graphs/a workspace to safely try out Superset development. Enjoy!

32
docker-compose.yml Normal file
View File

@@ -0,0 +1,32 @@
version: '3'
services:
superset:
init: true
build:
context: ./superset
dockerfile: Dockerfile
container_name: superset
volumes:
- ./superset_home:/app/superset_home
environment:
- DATABASE_DB=superset
- DATABASE_HOST=db
- DATABASE_PASSWORD=superset
- DATABASE_USER=superset
- DATABASE_PORT=5432
ports:
- '8080:8088'
database:
init: true
image: postgres:alpine
container_name: superset_db
volumes:
- ./postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=superset
- POSTGRES_USER=superset
- POSTGRES_PASSWORD=secretsecret
ports:
- '5000:5432'

9
setup.sh Executable file
View File

@@ -0,0 +1,9 @@
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email admin@localhost \
--password secret
docker exec -it superset superset db upgrade &&
docker exec -it superset superset init

9
superset/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM apache/superset:3.0.2
USER root
COPY --chmod=777 superset_config.py /app/
ENV SUPERSET_CONFIG_PATH /app/superset_config.py
USER superset
ENTRYPOINT [ "/usr/bin/run-server.sh" ]

View File

@@ -0,0 +1,4 @@
ENABLE_PROXY_FIX = True
SECRET_KEY = "MyVerySecretKey"
PREVENT_UNSAFE_DB_CONNECTIONS = False
TALISMAN_ENABLED = False