I have multiple Python scripts from which I want to run a docker container. From a related question How to run multiple Python scripts and an executable files using Docker? , I found that the best way to do that is to have run.sh
a shell file as follows:
#!/bin/bash
python3 producer.py &
python3 consumer.py &
python3 test_conn.py
and then call this file from a Dockerfile as:
FROM python:3.9
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
CMD ["./run.sh"]
However, in the container logs the following error is prompting exec ./run.sh: no such file or directory
, which makes no sense to me since I copied everything on the current directory, run.sh included, to /usr/src/app on my container via COPY . /usr/src/app
Please, clone my repo and on the root directory call docker-compose up -d and check myapp container logs to help me.
https://github.com/Quilograma/IES_Project
Thank you!
Can't run multiple python scripts in a single container.