Skip to content

Commit

Permalink
Merge pull request #2 from Ecosystem-Assessments/CST-241-deploy-app
Browse files Browse the repository at this point in the history
CST-241 Dockerisation
  • Loading branch information
david-beauchesne authored Jan 30, 2024
2 parents e0d9781 + 99e5a50 commit ea18bb8
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
20 changes: 20 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: edriver
Title: eDriver
Version: 1.0.0
Authors@R:
person(given = "David",
family = "Beauchesne",
role = c("aut", "cre"),
email = "david.beauchesne@insileco.io")
Description: Shiny application to visualize eDrivers platform data.
License: GPLv3 + file LICENSE
Imports:
raster,
leaflet,
shiny,
shinyjs,
magrittr,
sf,
dplyr,
tidyr
Encoding: UTF-8
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Base R Shiny image
FROM rocker/geospatial:latest

RUN apt-get update && apt-get install -y

# Copy the Shiny app code
WORKDIR /home/app
ADD . /home/app

# Install R dependencies
RUN install2.r remotes
RUN Rscript -e 'remotes::install_deps()'

# Expose the application port
EXPOSE 8083

# Run the R Shiny app
CMD Rscript -e "shiny::runApp(port = 8083, host = '0.0.0.0')"
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# eDrivers application

Shiny application to visualize eDrivers platform data.

## Local deployment

```bash
Rscript -e "shiny::runApp(port = 8083, host = '0.0.0.0')"
```

## Docker deployment

**Requirements**

- Install docker on your computer: https://docs.docker.com/engine/install/

**Build and deploy the application within a container**

```bash
docker build -t edrivers . && docker run -p 8083:8083 -it --rm edriver
```
Deployment tested on `Docker version 25.0.0`


1 change: 0 additions & 1 deletion code/cumulIntensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# library(raster)
# library(magrittr)
# library(sf)
# library(rgdal)
# # load('./data/marimekkoFd.RData')
# # load('./data/drivers.RData')
# load('./data/dr.RData')
Expand Down
1 change: 0 additions & 1 deletion code/param.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ library(shiny)
library(shinyjs)
library(magrittr)
library(sf)
library(rgdal)
library(dplyr)
library(tidyr)

Expand Down

0 comments on commit ea18bb8

Please sign in to comment.