Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI to update an image on dockerhub #15

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: docker-compose-workflow
on:
push:
branches: [ "main", "develop" ]
branches: [ "develop" ]
pull_request:
branches: [ "main", "develop" ]
branches: [ "develop" ]

jobs:
test:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/docker-compose-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: docker-compose-workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: brianpondi/openeocubes:latest

- name: Run docker-compose
run: docker-compose up -d
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
FROM --platform=linux/amd64 rocker/r-ver:4.1
FROM --platform=linux/amd64 ubuntu:bionic

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common cmake g++ git supervisor wget
ENV TZ=Etc/UTC
RUN apt-get install -y libnetcdf-dev libcurl4-openssl-dev libcpprest-dev doxygen graphviz libsqlite3-dev libboost-all-dev
RUN add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 314DF160 && apt-get update && apt-get install -y libproj-dev libgdal-dev

# add key for R repository
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

# install R and necessary packages
#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
#RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/'
#RUN apt update -q && DEBIAN_FRONTEND=noninteractive apt install -q -y r-base
RUN Rscript -e "install.packages(c('devtools'))"
# add R repository
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'

# install R
RUN apt update -q && DEBIAN_FRONTEND=noninteractive apt install -q -y r-base

RUN mkdir -p /opt/dockerfiles/ && mkdir -p /var/openeo/workspace/ && mkdir -p /var/openeo/workspace/data/
# install devtools package
RUN Rscript -e "install.packages('devtools')"

# install gdalcubes package
RUN Rscript -e "install.packages('gdalcubes')"

# install other necessary packages
RUN apt-get install -y libsodium-dev libudunits2-dev
RUN Rscript -e "install.packages(c('plumber', 'useful', 'ids', 'R6', 'sf', 'rstac','bfast'))"

COPY ./ /opt/dockerfiles/
# create directories
RUN mkdir -p /opt/dockerfiles/ && mkdir -p /var/openeo/workspace/ && mkdir -p /var/openeo/workspace/data/

# install packages from local directory
COPY ./ /opt/dockerfiles/
RUN Rscript -e "remotes::install_local('/opt/dockerfiles',dependencies=TRUE)"

# cmd or entrypoint for startup
CMD ["R", "-q", "--no-save", "-f /opt/dockerfiles/Dockerfiles/start.R"]

EXPOSE 8000
EXPOSE 8000