diff --git a/Dockerfile b/Dockerfile index b43afbc..6bbb5f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,3 +39,6 @@ RUN chmod a+x /opt/scripts/*.sh # Switch back to the original user USER ${ORI_USER} + +ENTRYPOINT ["/opt/scripts/entrypoint.sh"] +CMD ["/opt/bitnami/scripts/spark/run.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 652e648..a74d845 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -95,7 +95,6 @@ services: build: context: . dockerfile: Dockerfile - entrypoint: /opt/scripts/notebook_entrypoint.sh container_name: spark-notebook ports: - "4041:4041" @@ -109,5 +108,6 @@ services: - MINIO_URL=http://minio:9000 - MINIO_ACCESS_KEY=minio - MINIO_SECRET_KEY=minio123 + - SPARK_MODE=notebook volumes: - ./cdr/cdm/jupyter:/cdm_shared_workspace \ No newline at end of file diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh new file mode 100644 index 0000000..93b1a4c --- /dev/null +++ b/scripts/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ "$SPARK_MODE" = "notebook" ]; then + exec /opt/scripts/notebook_entrypoint.sh "$@" +else + exec /opt/bitnami/scripts/spark/entrypoint.sh "$@" +fi \ No newline at end of file