Use this Dockerfile as a template to be able to create docker images that will execute a python script once the container is run.
This can be very useful if you have a python script working locally an you want to be able to have the python code run in the cloud (ie not on your local machine). Cloud services such as Google Cloud Run in GCP or Azure Container Instances in Azure are built specifically to be able to run docker containers.
FROM python:3.13-slim
# Set the working directory in the container to /app
WORKDIR /app
# Copy the current directory (i.e. the root directory of this repository) into the container at /app
COPY . /app/
# Install any necessary dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Run the command to start the application when the container starts
# the python file to run is called "main.py"
CMD ["python", "main.py"]