Rodja Trappe 9ed4df73ba renamed example dir пре 1 година
..
app 9ed4df73ba renamed example dir пре 1 година
README.md 9ed4df73ba renamed example dir пре 1 година
docker-compose.yml 9ed4df73ba renamed example dir пре 1 година

README.md

Docker Example

This example shows how to use the NiceGUI release docker image zauberzeug/nicegui from Docker Hub. It uses a docker-compose.yml file for convenience. Similar behavior can be archived with docker run and the corresponding parameters.

Try it out.

Alter the docker-compose.yml file to your local host user's uid/gid and then run

docker compose up

Special Docker Features

Storage

NiceGUI automatically creates a .nicegui directory in the applications root directory (/app inside the docker container). In this example we mount the local app folder into the /app location of the container. This makes the .nicegui folder persistent across docker restarts. You can access http://localhost:8080, enter some data for storage and verify by restarting the container.

Non-Root User

The app inside the container is executed as non-root. All files created by NiceGUI (for example the .nicegui persistence) will have the configured uid/gid.

Docker signals

The docker image will passe signals from Docker like SIGTERM to issue a graceful shutdown of NiceGUI. If you stop the container (eg. Ctrl+C) and look at the logs (docker compose logs) you should see it initiatedui.shutdown` method.