1

I need to create a docker compose file, through which I need to pull the latest files from a repo and run a python command. I searched many samples, but couldnt get any help.

So what I need to do is :

1. Clone the repo and get the latest scripts
2. Execute a python command.

So everytime, I do a docker-compose down and then docker-compose up, It will fetch the latest files from the repo. Please help me to create the docker compose file.

wanderors
  • 2,030
  • 5
  • 21
  • 35

1 Answers1

1

Here is the Dockerfile

FROM python

RUN git clone https://github.com/blackbird71SR/Hello-World

CMD ["python", "Hello-World/HelloWorld.py"]

Then you can build it and run it this way

docker build -t some_name .
docker run some_name
Mickael B.
  • 4,755
  • 4
  • 24
  • 48