mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
502 stars 131 forks source link

Pass command line arguments to Docker container #366

Open kickin6 opened 6 days ago

kickin6 commented 6 days ago

How do we pass command line arguments into the container?

davefojtik commented 6 days ago

You can overwrite the default CMD command and flags right in the docker run command:

docker run <image_name> <command> <flags>

Currently, the default Dockerfile CMD looks like this:

CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "8888", "--skip-pip"]

Let's suppose you want to change the port. You can run the container with:

docker run <image_name> python main.py --host 0.0.0.0 --port 9999 --skip-pip
kawikao commented 6 days ago

That's what I ended up doing which works. Cheers.