File tree Expand file tree Collapse file tree 6 files changed +104
-3
lines changed
Expand file tree Collapse file tree 6 files changed +104
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Image CI
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ pull_request :
7+ branches : ["main"]
8+
9+ env :
10+ IMAGE_NAME : shiny-meets-fastapi
11+ VERSION : latest
12+ CONTEXT : routes_example_app
13+
14+ jobs :
15+ build :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+ - name : Build the Docker image
21+ run : |
22+ cd $CONTEXT
23+ docker build . --file Dockerfile --tag $IMAGE_NAME:$VERSION
24+
25+ - name : Log in to registry
26+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u token --password-stdin
27+
28+ - name : Push image to ghcr.io
29+ run : |
30+ image_id=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
31+ # repository name must be lowercase
32+ image_id=$(echo $image_id | tr '[A-Z]' '[a-z]')
33+ docker tag $IMAGE_NAME:$VERSION $image_id:$VERSION
34+ docker push $image_id:$VERSION
Original file line number Diff line number Diff line change 1+ name : Docker Image CI
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ pull_request :
7+ branches : ["main"]
8+
9+ env :
10+ IMAGE_NAME : shinylive-nginx
11+ VERSION : latest
12+ CONTEXT : shinylive_without_quarto
13+
14+ jobs :
15+ build :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+ - name : Build the Docker image
21+ run : |
22+ cd $CONTEXT
23+ docker build . --file Dockerfile --tag $IMAGE_NAME:$VERSION
24+
25+ - name : Log in to registry
26+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u token --password-stdin
27+
28+ - name : Push image to ghcr.io
29+ run : |
30+ image_id=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
31+ # repository name must be lowercase
32+ image_id=$(echo $image_id | tr '[A-Z]' '[a-z]')
33+ docker tag $IMAGE_NAME:$VERSION $image_id:$VERSION
34+ docker push $image_id:$VERSION
Original file line number Diff line number Diff line change @@ -41,3 +41,35 @@ shiny create -d basic_app_core -t basic-app -m core
4141gunicorn basic_app_core.app:app -w 4 -k uvicorn.workers.UvicornWorker
4242```
4343
44+ ## Examples
45+
46+ * [ basic_app] ( basic_app )
47+ * [ basic_app_core] ( basic_app_core )
48+ * [ routes_example_app] ( routes_example_app )
49+ * [ shinylive_quarto] ( shinylive_quarto )
50+ * [ shinylive_without_quarto] ( shinylive_without_quarto )
51+
52+ ## Docker Image Releases
53+
54+ ### Shinylive inside nginx
55+
56+ ``` bash
57+ docker pull ghcr.io/eoda-dev/shinylive-nginx:latest
58+
59+ docker run --rm -p 8085:80 ghcr.io/eoda-dev/shinylive-nginx:latest
60+ ```
61+
62+ Navigate to [ http://localhost:8085/shinylive-app/ ] ( http://localhost:8085/shinylive-app/ )
63+
64+ ### Shiny and FastAPI in one app
65+
66+ ``` bash
67+ docker pull ghcr.io/eoda-dev/shiny-meets-fastapi:latest
68+
69+ docker run -p 3333:3333 --rm ghcr.io/eoda-dev/shiny-meets-fastapi:latest
70+ ```
71+
72+ Navigate to:
73+
74+ * Shiny app: [ http://localhost:3333 ] ( http://localhost:3333 )
75+ * FastAPI REST API docs: [ http://localhost:3333/api/docs ] ( http://localhost:3333/api/docs )
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ docker build -t shiny-for-py/basic-app-core:1.0.0 .
66docker run -p 3333:3333 --rm -d shiny-for-py/basic-app-core:1.0.0
77```
88
9+ Navigate to [ http://localhost:3333 ] ( http://localhost:3333 ) .
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ quarto render index.qmd
1111python -m http.server
1212```
1313
14- Then navigate to [ localhost:8000] ( http://localhost:8000 )
14+ Navigate to [ http:// localhost:8000] ( http://localhost:8000 ) .
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Start local webserver to server the app:
2222python3 -m http.server --directory site --bind localhost 8008
2323```
2424
25- Navigate to [ http://localhost:8008 ] ( http://localhost:8008 )
25+ Navigate to [ http://localhost:8008 ] ( http://localhost:8008 ) .
2626
2727Build Docker image to server site with Nginx:
2828
@@ -32,4 +32,4 @@ docker build -t shiny-for-py/shinylive-app-nginx:1.0.0 .
3232docker run -p 8085:80 --rm shiny-for-py/shinylive-app-nginx:1.0.0
3333```
3434
35- Navigate to [ http://localhost:8085/shinylive-app/ ] ( http://localhost:8085/shinylive-app/ )
35+ Navigate to [ http://localhost:8085/shinylive-app/ ] ( http://localhost:8085/shinylive-app/ ) .
You can’t perform that action at this time.
0 commit comments