This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile-r-service
70 lines (58 loc) · 1.94 KB
/
Dockerfile-r-service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM tworavens/psi-r-service-base:latest
MAINTAINER Raman Prasad (raman_prasad@harvard.edu)
LABEL organization="PSI" \
2ra.vn.version="0.0.6-beta" \
2ra.vn.release-date="2018-01-11" \
description="Image for the PSI R service, which runs on rook."
# -------------------------------------
# Install R openssl library
# -------------------------------------
#RUN R -e 'install.packages("openssl", repos="http://cran.rstudio.org")'
RUN R -e 'library(devtools);install_github("privacytoolsproject/PSI-Library")'
# -------------------------------------
# Install Tex Base
# -------------------------------------
RUN apt-get update && \
apt-get install -y pandoc \
texlive-full
RUN tlmgr init-usertree
# -------------------------------------
# Copy the repo over
# - future: ignore the tworavens django dirs
# and assets, be more selective
# -------------------------------------
RUN mkdir -p /var/webapps/PSI && \
mkdir -p /var/webapps/PSI/assets && \
mkdir -p /var/webapps/PSI/data && \
mkdir -p /psi_volume
# Copy over the repository
COPY ./rook/ /var/webapps/PSI/rook
COPY ./LICENSE /var/webapps/PSI
COPY ./README.md /var/webapps/PSI
COPY ./data/ /var/webapps/PSI/data
# -------------------------------------
# Create a volume for outside info
# -------------------------------------
VOLUME /psi_volume
# -------------------------------------
# Expose port for the web (rook)
# -------------------------------------
EXPOSE 8000
WORKDIR /var/webapps/PSI/rook
# -------------------------------------
# Run django with "rook_nonstop.R"
# -------------------------------------
CMD Rscript rook_nonstop.R
# -----------------------------------------
# -- Dev notes --
#
# build local:
# >docker build -t rook1 -f ./Dockerfile-r-service .
#
# shell access:
# >docker run -ti -p 8000:8000 rook1 /usr/bin/bash
#
# run app
# >docker run -p 8000:8000 rook1
# go to: http://0.0.0.0:8000/subsetapp
# -----------------------------------------