diff --git a/Dockerfile b/Dockerfile index 19cf8bd..34f607f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,8 @@ RUN apt-get update &&\ apt-get install -y expect &&\ apt-get install -y jq +COPY ./install_dependencies.sh . +RUN chmod +x ./install_dependencies.sh &&\ + sh install_dependencies.sh + CMD [ "bash", "./run.sh" ] diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100644 index 0000000..e88ef32 --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Get repository +git clone https://github.com/aiven/python-fake-data-producer-for-apache-kafka.git +pip install -r python-fake-data-producer-for-apache-kafka/requirements.txt +pip install aiven-client diff --git a/run.sh b/run.sh index 28a7471..1b30018 100755 --- a/run.sh +++ b/run.sh @@ -1,11 +1,6 @@ # Read env parameters . conf/env.conf -# Get repository -git clone https://github.com/aiven/python-fake-data-producer-for-apache-kafka.git -pip install -r python-fake-data-producer-for-apache-kafka/requirements.txt -pip install aiven-client - # Get Hostname and Port HOSTNAME=$(avn --auth-token $TOKEN service get $SERVICE_NAME --project $PROJECT_NAME --json | jq -r '.components[] | select(.component=="kafka").host') PORT=$(avn --auth-token $TOKEN service get $SERVICE_NAME --project $PROJECT_NAME --json | jq -r '.components[] | select(.component=="kafka").port')