README.md 2.07 KB
Newer Older
Virgile Baudrot's avatar
Virgile Baudrot committed
1
[![pipeline status](https://gitlab.paca.inrae.fr/vbaudrot/r-shiny-app-ci-cd/badges/master/pipeline.svg)](https://gitlab.paca.inrae.fr/vbaudrot/r-shiny-app-ci-cd/commits/master)
Jean-Francois Rey's avatar
Jean-Francois Rey committed
2

Virgile Baudrot's avatar
Virgile Baudrot committed
3
4
5
6
7

## Inline Shiny App

[Inline briskaR App](https://shiny.biosp.inrae.fr/app/briskaR)

Virgile Baudrot's avatar
README    
Virgile Baudrot committed
8
## Authors
Jean-Francois Rey's avatar
Jean-Francois Rey committed
9

Virgile Baudrot's avatar
Virgile Baudrot committed
10
11
* [Virgile Baudrot](https://www.researchgate.net/profile/Virgile_Baudrot)
* [Jean-François Rey](https://jeff.biosp.org) \<jean-francois.rey at inra.fr\>
Jean-Francois Rey's avatar
Jean-Francois Rey committed
12

Virgile Baudrot's avatar
Virgile Baudrot committed
13
## License
Jean-Francois Rey's avatar
Jean-Francois Rey committed
14

Virgile Baudrot's avatar
Virgile Baudrot committed
15
See [LICENSE](LICENSE)
Jean-Francois Rey's avatar
Jean-Francois Rey committed
16

Virgile Baudrot's avatar
Virgile Baudrot committed
17
## Run localy Docker App image
Jean-Francois Rey's avatar
Jean-Francois Rey committed
18

Virgile Baudrot's avatar
Virgile Baudrot committed
19
20
Either downloads the artifact `briskaRshinyApp_*.tar.gz` or from the folder `briskaRshinyApp`,
build the Archive of the package `briskaRshinyApp_*.tar.gz`.
Virgile Baudrot's avatar
Virgile Baudrot committed
21

Virgile Baudrot's avatar
Virgile Baudrot committed
22
To build the archive, run command lines:
Virgile Baudrot's avatar
Virgile Baudrot committed
23

Virgile Baudrot's avatar
Virgile Baudrot committed
24
25
26
27
28
29
```
R CMD build --no-build-vignettes --no-manual briskaRshinyApp/
mv briskaRshinyApp_*.tar.gz briskaRshinyApp/briskaRshinyApp_*.tar.gz
```

Then run (before move within folder `briskaRshinyApp/`):
Jean-Francois Rey's avatar
Jean-Francois Rey committed
30

Virgile Baudrot's avatar
Virgile Baudrot committed
31
```
Virgile Baudrot's avatar
Virgile Baudrot committed
32
sudo docker build --build-arg APP_NAME=briskaRapp --tag briskarshinyapp:latest -f Dockerfile .
Virgile Baudrot's avatar
Virgile Baudrot committed
33
```
Jean-Francois Rey's avatar
Jean-Francois Rey committed
34

Virgile Baudrot's avatar
Virgile Baudrot committed
35
Check images build 
Jean-Francois Rey's avatar
Jean-Francois Rey committed
36

Virgile Baudrot's avatar
Virgile Baudrot committed
37
38
39
```
sudo docker images
```
Jean-Francois Rey's avatar
Jean-Francois Rey committed
40

Virgile Baudrot's avatar
Virgile Baudrot committed
41
One of the line should look like this:
Jean-Francois Rey's avatar
Jean-Francois Rey committed
42
```
Virgile Baudrot's avatar
Virgile Baudrot committed
43
44
REPOSITORY                                       TAG                 IMAGE ID            CREATED              SIZE
briskarshinyapp                                  latest              13d38651faf5        About a minute ago   2.89GB
Virgile Baudrot's avatar
Virgile Baudrot committed
45
```
Jean-Francois Rey's avatar
Jean-Francois Rey committed
46

Virgile Baudrot's avatar
Virgile Baudrot committed
47
Get and execute localy the docker image of the app.
Jean-Francois Rey's avatar
Jean-Francois Rey committed
48

Virgile Baudrot's avatar
Virgile Baudrot committed
49
50
51
```
sudo docker run -p 3838:3838 --name briskaRapp briskarshinyapp:latest 
```
Virgile Baudrot's avatar
Virgile Baudrot committed
52
The application is then accessible at : [http://localhost:3838](http://localhost:3838)  
Jean-Francois Rey's avatar
Jean-Francois Rey committed
53
54


Virgile Baudrot's avatar
Virgile Baudrot committed
55
To stop and remove container
Jean-Francois Rey's avatar
Jean-Francois Rey committed
56

Virgile Baudrot's avatar
Virgile Baudrot committed
57
58
```
sudo docker stop briskaRapp
Virgile Baudrot's avatar
Virgile Baudrot committed
59
sudo docker container rm briskaRapp
Jean-Francois Rey's avatar
Jean-Francois Rey committed
60
61
```

Virgile Baudrot's avatar
Virgile Baudrot committed
62
63
64
65
66
67
## Regenerate Docker image


From the folder `briskaRshinyApp`, build the Archive of the package ` briskaRshinyApp_*.tar.gz`.

Then run:
Jean-Francois Rey's avatar
Jean-Francois Rey committed
68

Virgile Baudrot's avatar
Virgile Baudrot committed
69
```
Virgile Baudrot's avatar
Virgile Baudrot committed
70
sudo docker build --build-arg APP_NAME=briskaRapp --tag briskarshinyapp:latest -f Dockerfile .
Virgile Baudrot's avatar
Virgile Baudrot committed
71
```
Jean-Francois Rey's avatar
Jean-Francois Rey committed
72

Virgile Baudrot's avatar
Virgile Baudrot committed
73
or build Docker image from gitlab repository:
Jean-Francois Rey's avatar
Jean-Francois Rey committed
74

Virgile Baudrot's avatar
Virgile Baudrot committed
75
76
77
```
sudo docker build --build-arg APP_NAME=briskaRapp --cache-from gitlab.paca.inra.fr:4567/vbaudrot/briskarshinyapp:latest --tag briskarshinyapp:latest -f Dockerfile .
```