Sfoglia il codice sorgente

#355 moved docker info to website

Rodja Trappe 2 anni fa
parent
commit
5c88b97ac4
2 ha cambiato i file con 13 aggiunte e 12 eliminazioni
  1. 0 12
      README.md
  2. 13 0
      main.py

+ 0 - 12
README.md

@@ -92,15 +92,3 @@ We have built on top of [FastAPI](https://fastapi.tiangolo.com/),
 which itself is based on the ASGI framework [Starlette](https://www.starlette.io/)
 and the ASGI webserver [Uvicorn](https://www.uvicorn.org/)
 because of their great performance and ease of use.
-
-## Docker
-
-You can use our [multi-arch Docker image](https://hub.docker.com/repository/docker/zauberzeug/nicegui):
-
-```bash
-docker run --rm -p 8888:8080 -v $(pwd):/app/ -it zauberzeug/nicegui:latest
-```
-
-This will start the server at http://localhost:8888 with the code from your current directory.
-The file containing your `ui.run(port=8080, ...)` command must be named `main.py`.
-Code modification triggers an automatic reload.

+ 13 - 0
main.py

@@ -175,6 +175,19 @@ ui.run()
                 ui.markdown('Enjoy!').classes('text-lg')
                 with browser_window(classes='w-full h-52'):
                     ui.label('Hello NiceGUI!')
+        with ui.expansion('Or use Docker to run your main.py').classes('w-full gap-2'):
+            with ui.row().classes('mt-8 w-full text-lg justify-center items-center gap-8'):
+                ui.markdown('''
+You can use our [multi-arch Docker image](https://hub.docker.com/repository/docker/zauberzeug/nicegui):
+
+This will start the server at http://localhost:8888 with the code from your current directory.
+The file containing your `ui.run(port=8080, ...)` command must be named `main.py`.
+Code modification triggers an automatic reload.
+''').classes('max-w-xl')
+                with bash_window(classes='max-w-lg w-full h-52'):
+                    ui.markdown('```bash\n'
+                                'docker run -it --rm -p 8000:8000 \\\n -v "$PWD":/app zauberzeug/nicegui\n'
+                                '```')
 
     with ui.column().classes('w-full p-8 lg:p-16 max-w-[1600px] mx-auto'):
         link_target('examples', '-50px')