-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
38 lines (29 loc) · 1.08 KB
/
Dockerfile
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
FROM rocker/rstudio:3.5.2
WORKDIR /
# Copy directories
COPY main main
COPY inputs inputs
COPY ancillary ancillary
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
wget \
zip
# Get input files
WORKDIR /inputs
RUN wget 'http://fenixservices.fao.org/faostat/static/bulkdownloads/Trade_DetailedTradeMatrix_E_All_Data_(Normalized).zip'
RUN wget 'http://fenixservices.fao.org/faostat/static/bulkdownloads/Production_Crops_E_All_Data_(Normalized).zip'
RUN wget 'https://apps.fas.usda.gov/psdonline/downloads/psd_grains_pulses_csv.zip'
# Unzip input files
RUN unzip 'Trade_DetailedTradeMatrix_E_All_Data_(Normalized).zip'
RUN unzip 'Production_Crops_E_All_Data_(Normalized).zip'
RUN rm 'psd_grains_pulses.csv'
RUN unzip 'psd_grains_pulses_csv.zip'
# Remove zip files
RUN rm 'Trade_DetailedTradeMatrix_E_All_Data_(Normalized).zip'
RUN rm 'Production_Crops_E_All_Data_(Normalized).zip'
RUN rm 'psd_grains_pulses_csv.zip'
# Run set up R Scripts
WORKDIR /
RUN Rscript /main/Requirements.R
RUN Rscript /main/MatrixCreation.R
# Container entrypoint
ENTRYPOINT ["Rscript", "/main/main.R"]