mrhan1993 / Fooocus-API

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

Pass command line arguments to Docker container #366

Closed kickin6 closed 4 months ago

kickin6 commented 5 months ago

How do we pass command line arguments into the container?

davefojtik commented 5 months 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 5 months ago

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