Customizing docker image building it and using it to deploy superset
Tutorial to follow along
Steps For youtube
-
To create custom docker image lets clone superset's github Repo using following command. To reduce time and resources we will only clone till depth 1 and for this tutorial I am selecting 4.0 branch.
git clone --depth=1 -b 4.0 https://github.com/apache/superset.git
-
Let's move to directory
cd superset
-
Create a dir I am calling it to_be_copied and create following directory structure in it
- to_be_copied_into_assets
- {your_project_}images
- logo.png
- favicon.png -
Open
Dockerfile
findWORKDIR /app
for me it is on line 65 (In future it might change). Add following code below itCOPY --chown=superset:superset to_be_copied_into_assets /app/superset/static/assets
-
Creating docker image using following command
docker build -t shan-superset .
-
Need to do few changes to get our image running open
docker-compose-non-dev.yml
and change image name to shan-superset -
Once done lets try to run it using
docker compose -f docker-compose-non-dev.yml up
-
Check the logs and check if everything is running fine you can use
-d
flag as shown below.docker compose -f docker-compose-non-dev.yml up -d