-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
3,130 additions
and
20 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 @@ | ||
source("renv/activate.R") |
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,88 @@ | ||
name: Build | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- docker-container | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image_name: "${{ steps.meta.outputs.tags }}@${{ steps.build_push_action.outputs.digest }}" | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build_push_action | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
provenance: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
# scan: | ||
# runs-on: ubuntu-latest | ||
# needs: build-and-push-image | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Scan image | ||
# id: scan | ||
# uses: anchore/[email protected] | ||
# with: | ||
# fail-build: false | ||
# image: ${{needs.build-and-push-image.outputs.image_name}} | ||
# - name: upload Anchore scan SARIF report | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: ${{ steps.scan.outputs.sarif }} | ||
|
||
# deploy: | ||
# runs-on: ubuntu-latest | ||
# needs: scan | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# env: | ||
# CG_USERNAME: ${{ secrets.CG_USERNAME }} | ||
# if: ${{ env.CG_USERNAME }} | ||
# - name: Deploy to cloud.gov | ||
# uses: cloud-gov/cg-cli-tools@main | ||
# env: | ||
# CG_USERNAME: ${{ secrets.CG_USERNAME }} | ||
# if: ${{ env.CG_USERNAME }} | ||
# with: | ||
# cf_username: ${{ secrets.CG_USERNAME }} | ||
# cf_password: ${{ secrets.CG_PASSWORD }} | ||
# cf_org: ${{ secrets.CF_ORG }} | ||
# cf_space: ${{ secrets.CF_SPACE }} | ||
# command: cf delete Heat_CVD_UHI_Dashboard -f ; cf push -f manifest.yml |
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,88 @@ | ||
name: Build | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- docker-container | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image_name: "${{ steps.meta.outputs.tags }}@${{ steps.build_push_action.outputs.digest }}" | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build_push_action | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
provenance: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
# scan: | ||
# runs-on: ubuntu-latest | ||
# needs: build-and-push-image | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Scan image | ||
# id: scan | ||
# uses: anchore/[email protected] | ||
# with: | ||
# fail-build: false | ||
# image: ${{needs.build-and-push-image.outputs.image_name}} | ||
# - name: upload Anchore scan SARIF report | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: ${{ steps.scan.outputs.sarif }} | ||
|
||
# deploy: | ||
# runs-on: ubuntu-latest | ||
# needs: scan | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# env: | ||
# CG_USERNAME: ${{ secrets.CG_USERNAME }} | ||
# if: ${{ env.CG_USERNAME }} | ||
# - name: Deploy to cloud.gov | ||
# uses: cloud-gov/cg-cli-tools@main | ||
# env: | ||
# CG_USERNAME: ${{ secrets.CG_USERNAME }} | ||
# if: ${{ env.CG_USERNAME }} | ||
# with: | ||
# cf_username: ${{ secrets.CG_USERNAME }} | ||
# cf_password: ${{ secrets.CG_PASSWORD }} | ||
# cf_org: ${{ secrets.CF_ORG }} | ||
# cf_space: ${{ secrets.CF_SPACE }} | ||
# command: cf delete Heat_CVD_UHI_Dashboard -f ; cf push -f manifest.yml |
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,3 @@ | ||
ignore: | ||
- package: | ||
location: "/opt/shiny-server/node_modules/**" |
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,47 @@ | ||
# The image is based off of the rocker base image, which you can learn about here: | ||
# https://rocker-project.org/ | ||
# The image is based off of ubuntu, but then runs a few scripts to install R and R shiny | ||
FROM rocker/shiny:latest | ||
|
||
# I added this label, though it doesn't do anything | ||
LABEL name=CBCS | ||
|
||
# I reset the ubuntu package mirror to the Oregon State open source lab, because at some point while I was working on this | ||
# the official ubuntu package mirror went offline, but this can probably be removed | ||
RUN sed -i -e 's/http:\/\/archive\.ubuntu\.com\/ubuntu\//http:\/\/ubuntu\.osuosl\.org\/ubuntu/' /etc/apt/sources.list | ||
|
||
# This part is the part that installs the system packages, usually needed for use in compiling some R package. | ||
# I just added packages to this list as I got errors | ||
RUN apt-get update && apt-get install -y \ | ||
libssl-dev \ | ||
libxml2-dev \ | ||
libgit2-dev \ | ||
default-jdk \ | ||
r-cran-rjava \ | ||
r-base-dev dh-r automake \ | ||
libharfbuzz-dev libfribidi-dev \ | ||
libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \ | ||
libgdal-dev \ | ||
libudunits2-dev \ | ||
cmake \ | ||
&& apt-get clean | ||
|
||
# This sets the main path in the docker image to /app, which is a standard practice. | ||
WORKDIR /app | ||
|
||
# This is part copies in the renv dependency list | ||
# The reason this is copied in seperately is for caching. Docker if it sees the dependencies haven't changed doesn't have to spend | ||
# the time re-compiling everything | ||
COPY renv.lock renv.lock | ||
RUN mkdir -p renv | ||
COPY .Rprofile .Rprofile | ||
COPY renv/activate.R renv/activate.R | ||
COPY renv/settings.dcf renv/settings.dcf | ||
RUN Rscript -e 'install.packages("renv")' | ||
RUN Rscript -e 'renv::restore()' | ||
|
||
# This part copies in the rest of the project | ||
COPY . /app | ||
|
||
# This sets what is run when the docker image is run | ||
CMD ["Rscript", "run.R"] |
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,47 @@ | ||
# The image is based off of the rocker base image, which you can learn about here: | ||
# https://rocker-project.org/ | ||
# The image is based off of ubuntu, but then runs a few scripts to install R and R shiny | ||
FROM rocker/shiny:latest | ||
|
||
# I added this label, though it doesn't do anything | ||
LABEL name=MyPracticeApp1 | ||
|
||
# I reset the ubuntu package mirror to the Oregon State open source lab, because at some point while I was working on this | ||
# the official ubuntu package mirror went offline, but this can probably be removed | ||
RUN sed -i -e 's/http:\/\/archive\.ubuntu\.com\/ubuntu\//http:\/\/ubuntu\.osuosl\.org\/ubuntu/' /etc/apt/sources.list | ||
|
||
# This part is the part that installs the system packages, usually needed for use in compiling some R package. | ||
# I just added packages to this list as I got errors | ||
RUN apt-get update && apt-get install -y \ | ||
libssl-dev \ | ||
libxml2-dev \ | ||
libgit2-dev \ | ||
default-jdk \ | ||
r-cran-rjava \ | ||
r-base-dev dh-r automake \ | ||
libharfbuzz-dev libfribidi-dev \ | ||
libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \ | ||
libgdal-dev \ | ||
libudunits2-dev \ | ||
cmake \ | ||
&& apt-get clean | ||
|
||
# This sets the main path in the docker image to /app, which is a standard practice. | ||
WORKDIR /app | ||
|
||
# This is part copies in the renv dependency list | ||
# The reason this is copied in seperately is for caching. Docker if it sees the dependencies haven't changed doesn't have to spend | ||
# the time re-compiling everything | ||
COPY renv.lock renv.lock | ||
RUN mkdir -p renv | ||
COPY .Rprofile .Rprofile | ||
COPY renv/activate.R renv/activate.R | ||
COPY renv/settings.dcf renv/settings.dcf | ||
RUN Rscript -e 'install.packages("renv")' | ||
RUN Rscript -e 'renv::restore()' | ||
|
||
# This part copies in the rest of the project | ||
COPY . /app | ||
|
||
# This sets what is run when the docker image is run | ||
CMD ["Rscript", "run.R"] |
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
Oops, something went wrong.