Skip to content

Commit 957e1dd

Browse files
Merge pull request #1 from researchapps/add/dockerfile
Adding docker container to reproduce interface with rstudio
2 parents 8e79c25 + 6caa50f commit 957e1dd

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.rstudio

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM docker.io/rocker/verse:3.6.2
2+
3+
RUN r -e 'install.packages("shiny")'
4+
RUN r -e 'install.packages("flexdashboard")'
5+
RUN r -e 'install.packages("knitr")'
6+
RUN r -e 'install.packages("dplyr")'
7+
RUN r -e 'install.packages("tidyr")'
8+
RUN r -e 'install.packages("DT")'
9+
RUN r -e 'install.packages("stringr")'
10+
RUN r -e 'install.packages("purrr")'
11+
RUN r -e 'install.packages("ngram")'
12+
RUN r -e 'install.packages("htmltools")'
13+
14+
LABEL maintainer='Pablo Bernabeu <pcbernabeu@gmail.com>' \
15+
org.opencontainers.image.authors='Bernabeu and Sochat' \
16+
org.opencontainers.image.url='https://github.com/pablobernabeu/Experimental-data-simulation' \
17+
org.opencontainers.image.documentation='https://github.com/pablobernabeu/Experimental-data-simulation' \
18+
org.opencontainers.image.version='1.0.0'
19+
20+
# Usage instructions:
21+
# $ docker build -t experiment-shiny-app .
22+
# $ docker run --interactive --rm -e PASSWORD=<MYPASSWORD> -p 8787:8787 --name experiment-shiny-app --volume $(pwd):/home/rstudio experiment-shiny-app

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@ This web application is suitable for educational and research purposes in experi
88

99
<a href="https://github.com/pablobernabeu/Experimental-data-simulation/raw/master/Screenshot.png"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://github.com/pablobernabeu/Experimental-data-simulation/raw/master/Screenshot.png" /></a>
1010

11+
### Development
12+
13+
If you want to develop or use the application locally, this can be done easily with the included [Dockerfile](Dockerfile).
14+
First, build the container:
15+
16+
```bash
17+
docker build -t experiment-shiny-app .
18+
```
19+
20+
And then run the container, selecting a password for the interface and binding to port 8787 on your local machine.
21+
22+
```bash
23+
$ docker run --interactive --rm -e PASSWORD=<MYPASSWORD> -p 8787:8787 --name experiment-shiny-app --volume $(pwd):/home/rstudio experiment-shiny-app
24+
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
25+
[s6-init] ensuring user provided files have correct perms...exited 0.
26+
[fix-attrs.d] applying ownership & permissions fixes...
27+
[fix-attrs.d] done.
28+
[cont-init.d] executing container initialization scripts...
29+
[cont-init.d] add: executing...
30+
Nothing additional to add
31+
[cont-init.d] add: exited 0.
32+
[cont-init.d] userconf: executing...
33+
[cont-init.d] userconf: exited 0.
34+
[cont-init.d] done.
35+
[services.d] starting services
36+
[services.d] done.
37+
```
38+
39+
You can then open [127.0.0.1:8787](127.0.0.1:8787) to see the interface and login with username "rstudio" and
40+
your chosen password. You can then select the RmD file and click "Run Document" to generate the window for the application,
41+
shown below.
42+
43+
![img/interface.png](img/interface.png)
44+
1145
### Reference
1246

1347
Bernabeu, P., & Lynott, D. (2020). Web application for the simulation of experimental data (Version 0.2). Retrieved from [https://github.com/pablobernabeu/Experiment-simulation-app/](https://github.com/pablobernabeu/Experiment-simulation-app/).

img/interface.png

365 KB
Loading

0 commit comments

Comments
 (0)