Skip to content

Commit

Permalink
Add shiny Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
almahmoud committed Dec 8, 2023
1 parent 417e83f commit d3ae8e1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build shiny Docker image
on:
workflow_dispatch: {}
push: {}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for container image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value={{branch}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64

- name: Build and push container image to ghcr
uses: docker/build-push-action@v3
with:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/bioconductor/shiny:devel

RUN chown shiny /usr/local/lib/R/site-library && chown shiny /usr/local/lib/R/library && rm -rf /srv/shiny-server/sample-apps && curl -o /srv/shiny-server/index.html https://gist.githubusercontent.com/almahmoud/58261d03bfb342274f2e642c4b2ebc4d/raw/4e0271990bce57ae091f622db47b15f8fd89fa29/index.html && mkdir -p /srv/shiny-server/biocshiny && sed -i '/^run_as shiny;/a app_init_timeout 300;\napp_idle_timeout 300;' /etc/shiny-server/shiny-server.conf

COPY app.R /srv/shiny-server/biocshiny/app.R

0 comments on commit d3ae8e1

Please sign in to comment.