nicegui Docker & Self-Hosted Deployment

GitHub

Create web-based user interfaces with Python. The nice way.

16,308 stars Python Python 54 files ยท ~8,025 tokens #frontend#gui#interaction#interface#interfaces#python#robotics#scripting
RAW Compose
1. Pull Image (DOCKERHUB) docker pull library/traefik
2. Docker Run (1-Click Launch) docker run -d --name nicegui -p 80:80 --restart always traefik:v2.3
3. Podman Run podman run -d --name nicegui -p 80:80 --restart always traefik:v2.3
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/library/traefik:v2.3
5. ORAS Pull (OCI Artifact) oras pull traefik:v2.3
6. Compose Deployment docker compose up -d
docker-compose.yml
Download .yml
services:
  app:
    build:
      context: ./
      dockerfile: development.dockerfile
    ports:
      - 80:8080
    volumes:
      - ./:/app
      - /app/.venv # anonymous volume to not sync the local venv, see here: https://docs.astral.sh/uv/guides/integration/docker/#developing-in-a-container
    labels:
      - traefik.http.routers.app.rule=PathPrefix(`/app`)
      - traefik.http.services.app.loadbalancer.server.port=8080
      - traefik.http.middlewares.app-prefix.stripprefix.prefixes=/app
      - traefik.http.middlewares.app-prefix.stripprefix.forceSlash=false # see https://doc.traefik.io/traefik/middlewares/stripprefix/#forceslash
      - traefik.http.routers.app.middlewares=app-prefix

  # setup a proxy to test hosting on a sub-path; here localhost:8080/app
  proxy:
    image: traefik:v2.3
    command:
      - --providers.docker
      - --accesslog # http access log
      - --log #Traefik log, for configurations and errors
      - --api # Enable the Dashboard and API
    ports:
      - "8888:80"
    volumes:
      # Traefik must be able to listen for Docker events
      - /var/run/docker.sock:/var/run/docker.sock