Skip to content

Commit bc39e5c

Browse files
committed
Merge branch 'main' into dev
2 parents 84ed624 + b06de27 commit bc39e5c

File tree

6 files changed

+104
-3
lines changed

6 files changed

+104
-3
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,35 @@ shiny create -d basic_app_core -t basic-app -m core
4141
gunicorn 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)

basic_app_core/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ docker build -t shiny-for-py/basic-app-core:1.0.0 .
66
docker 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).

shinylive_quarto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ quarto render index.qmd
1111
python -m http.server
1212
```
1313

14-
Then navigate to [localhost:8000](http://localhost:8000)
14+
Navigate to [http://localhost:8000](http://localhost:8000).

shinylive_without_quarto/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Start local webserver to server the app:
2222
python3 -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

2727
Build Docker image to server site with Nginx:
2828

@@ -32,4 +32,4 @@ docker build -t shiny-for-py/shinylive-app-nginx:1.0.0 .
3232
docker 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/).

0 commit comments

Comments
 (0)