-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#39) | feat : setup build process for avni superset image
- Loading branch information
Showing
4 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ARG TAG=latest | ||
|
||
FROM apache/superset:${TAG} | ||
|
||
|
||
#Copy avni logo and favicon | ||
ADD --chown=superset https://raw.githubusercontent.com/avniproject/avni-website/master/src/img/avni-logo-color.png /app/superset/static/assets/images/avni.png | ||
ADD --chown=superset https://github.com/avniproject/avni-webapp/raw/master/public/favicon.ico /app/superset/static/assets/images/avni-favicon.ico | ||
|
||
# Copy the configuration file, set the environment variable, | ||
COPY --chown=superset ./assets/superset_config.py /app/ | ||
|
||
#Environment variable | ||
ENV SUPERSET_SECRET_KEY="" | ||
ENV SUPERSET_DB_USER=postgres | ||
ENV SUPERSET_DB_PASSWORD=password | ||
ENV SUPERSET_DB_URL=host.docker.internal | ||
ENV SUPERSET_DB_PORT=5432 | ||
ENV SUPERSET_CONFIG_PATH=/app/superset_config.py | ||
|
||
|
||
# Expose the port | ||
EXPOSE 8088 | ||
|
||
|
||
# Run superset | ||
ENTRYPOINT ["superset", "run", "-h", "0.0.0.0", "-p", "8088", "--with-threads", "--reload", "--debugger"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
IMAGE := vedfordocker/superset | ||
TAG ?= 4.0.1 | ||
|
||
build-image: | ||
@echo "building image $(IMAGE):$(TAG)" | ||
docker image build --build-arg TAG=$(TAG) -t $(IMAGE):$(TAG) . | ||
|
||
re-build-image:delete-image | ||
@echo "building image $(IMAGE):$(TAG)" | ||
docker image build --build-arg version=$(TAG) -t $(IMAGE):$(TAG) . | ||
|
||
delete-image: | ||
@if docker image inspect $(IMAGE):$(TAG) > /dev/null 2>&1; then \ | ||
echo "Image $(IMAGE):$(TAG) found. Deleting..."; \ | ||
docker image rm -f $(IMAGE):$(TAG); \ | ||
else \ | ||
echo "Image $(IMAGE):$(TAG) not found."; \ | ||
fi | ||
|
||
push-image: | ||
docker push $(IMAGE):$(TAG) | ||
|
||
|
||
inspect-image: | ||
docker image inspect $(IMAGE):$(TAG) | ||
|
||
run-container: | ||
docker run -d -p 8088:8088 \ | ||
--name superset_$(TAG) \ | ||
--env-file superset.env \ | ||
$(IMAGE):$(TAG) | ||
@$(MAKE) get-container-logs | ||
|
||
remove-container: | ||
docker container rm -f superset_$(TAG) | ||
|
||
get-container-logs: | ||
docker logs -f superset_$(TAG) | ||
|
||
execute-container: | ||
docker container exec -it superset_$(TAG) bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters