From b7cbf7dd148235b8074abd9c2a91602bbe7159e2 Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Tue, 18 Mar 2025 08:57:06 +0100 Subject: [PATCH] Add bash script to run container --- run_container.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 run_container.sh diff --git a/run_container.sh b/run_container.sh new file mode 100644 index 0000000..72c3604 --- /dev/null +++ b/run_container.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Define container name and image +CONTAINER_NAME="datachain_processor" +IMAGE_NAME="datachain_processor" + +# Define ports +PORTS=( + "-p" "8889:8888" + "-p" "8050:8050" +) + +# Define environment variables +ENV_VARS=( + "-e" "DOCKER_CONTAINER=1" +) + +# Define volumes (add more as needed) +VOLUMES=( + "-v" "$(pwd)/data:/acsmdc/data" + "-v" "$(pwd)/figures:/acsmdc/figures" + "-v" "$(pwd)/pipelines/params:/acsmdc/pipelines/params" +) + +# Combine all options +DOCKER_OPTS=( + "--rm" + "-it" + "${PORTS[@]}" + "${ENV_VARS[@]}" + "${VOLUMES[@]}" +) + +# Run the container +docker run "${DOCKER_OPTS[@]}" "$IMAGE_NAME" bash -c "jupyter lab --NotebookApp.token='my-token' --ip=0.0.0.0 --allow-root & python app/data_flagging_app.py" \ No newline at end of file