Falko Schindler bd342113f2 fix some minor issues in examples vor 8 Monaten
..
app d9d65d0647 consistently use prefix "on_" for registering handlers only (fixes #1326) vor 1 Jahr
README.md 7cdd17763f some words about storage secret vor 1 Jahr
docker-compose.yml bd342113f2 fix some minor issues in examples vor 8 Monaten

README.md

Docker Example with NiceGUI

This README provides a walkthrough on how to utilize the NiceGUI release docker image, zauberzeug/nicegui, available on Docker Hub. The image is configured using a docker-compose.yml file for ease of use. You can achieve similar results using the docker run command along with its appropriate parameters.

Testing the Setup

Modify the docker-compose.yml file to reflect your local host user's uid/gid and then execute the command:

docker compose up

Special Docker Features

Data Persistence

NiceGUI automatically generates a .nicegui directory in the application's root directory (/app within the docker container). In this example, the local app folder is mounted to the /app location inside the container, ensuring that the .nicegui folder remains persistent across docker restarts. You can validate this by accessing http://localhost:8080, inputting some data for storage, and then restarting the container.

Non-Root User Execution

The application within the container operates as a non-root user (similar to the configs from linuxserver.io). Consequently, all files generated by NiceGUI (such as the .nicegui persistence) will bear the configured uid/gid.

Docker Signal Pass-Through

The docker image is designed to relay signals from Docker, such as SIGTERM, to initiate a graceful shutdown of NiceGUI. For instance, when you stop the container (using Ctrl+C) and subsequently examine the logs using the docker compose logs command, you should notice the initiation of the ui.shutdown method.

Storage Secret

In the example main.py we read the storage secret from a environment variable. This can then be defined in the docker-compose.yml (or even passed on from an .env file).