-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Sage-Bionetworks/ecs_setting
add docker image and specify environment variables
- Loading branch information
Showing
7 changed files
with
165 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
|
||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_PATH: ghcr.io/${{ github.repository }} | ||
|
||
jobs: | ||
tagging: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
|
||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
if: github.event_name == 'push' | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.IMAGE_PATH }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags}} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM sagebionetworks/shiny-base:release-1.0 | ||
# This is the expected application installation folder | ||
WORKDIR /srv/shiny-server/app | ||
COPY --chown=shiny ./ ./ | ||
|
||
# Set up Python and install the Synapse Python client | ||
RUN Rscript -e "install.packages('reticulate', repos='http://cran.rstudio.com/', verbose=FALSE)" | ||
RUN Rscript -e "library(reticulate); install_miniconda(); py_discover_config(); py_install(c('synapseclient', 'pandas'), pip = TRUE, pip_ignore_installed=TRUE)" | ||
|
||
# alternative to using renv | ||
#RUN Rscript -e "install.packages(c('shinydashboard','tidyverse','readxl','gt','gtsummary','survival','survminer','rsconnect','janitor','rjson'), repos='http://cran.rstudio.com/', verbose=FALSE)" | ||
|
||
# By default the log level is TRACE. We bump up one level to DEBUG to make the logs a bit less verbose | ||
ENV SHINY_LOG_LEVEL=DEBUG | ||
|
||
# set up r packages via renv. Use binary lib matching the shiny-base ubuntu version | ||
# to speed up installatioon. | ||
RUN Rscript -e 'renv::restore(repos="https://packagemanager.rstudio.com/all/__linux__/jammy/latest"); renv::install("./")' | ||
|
||
# running that script, to pass a configuration env var to Shiny | ||
RUN chmod +x dccmonitor_startup.sh | ||
CMD ["./dccmonitor_startup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/bash | ||
|
||
# Pass environment variable to Shiny | ||
echo "" >> .Renviron | ||
echo APP_REDIRECT_URL=$APP_REDIRECT_URL >> .Renviron | ||
|
||
# Now run the base start-up script | ||
./startup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters