I am embarking on my first attempt at utilizing a docker container. I have a python script that calls a couple API\'s and parses a file. The script took parameters for the
So let's assume your command is below
python app.py "URL" "APIKEY" "filepath"
So you will put your Dockerfile in below fashion
FROM python:3.6
WORKDIR /app
COPY app.py .
ENTRYPOINT ["python", "app.py"]
Then the person running the docker container would do it like below
docker run -v /home/tarun/project/filetoparse.yaml:/config.yaml "URL" "APIKEY" /config.yaml
If you want to give more flexibility you an can even use environment variables
docker run -v /home/tarun/project/filetoparse.yaml:/config.yaml -e APIKEY="XYZ" "URL" /config.yaml
And then in your script you can read it using os.environ['APIKEY']