-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (59 loc) · 2.41 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
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
71
72
73
74
75
76
77
78
79
FROM ubuntu:20.04 AS base
WORKDIR /r.avaflow
COPY . .
#4 Update packages repository, install locate
RUN apt-get update && \
apt-get install locales -y && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8
#5 Define system variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Europe/Moscow \
LC_ALL=en_US.UTF-8
#6 Use bash by default
RUN ln -fs /bin/bash /bin/sh
#7 Making sure that Python 3 is used
RUN apt install python3-pip -y && \
echo "alias python=python3" >> ~/.bash_aliases && \
source ~/.bash_aliases
#8 Selecting suitable repository
RUN apt install -y software-properties-common && \
add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y && \
apt update -y
#9 Installing necessary additional packages
RUN apt update && \
apt install libgeos-dev -y && \
apt install libproj-dev proj-data proj-bin -y && \
apt install libgdal-dev python3-gdal gdal-bin -y
#10 Installing GRASS GIS (dev package)
RUN apt update -y && \
apt install grass-dev grass-doc grass-gui -y
#11 Installing pillow
RUN apt install python3-pip -y && \
python3 -m pip install --upgrade pillow
#12 Installing R statistical software
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' && \
apt update -y && \
apt install r-base r-base-core -y
#13 Installing necessary additional R packages
RUN echo 'install.packages(c("stats","foreign","sp","rgeos","rgdal","raster","maptools","ROCR","fmsb", "Rcpp"), lib="/usr/lib/R/library/", repos = "http://cran.case.edu" )' > ./avaflow/install.packages.R && \
R CMD BATCH ./avaflow/install.packages.R
#14 Installing r.avaflow extension in GRASS GIS
RUN grass -c XY ./temp_grassdb/temp_location/ --exec g.extension extension=r.avaflow url=/r.avaflow/avaflow/ && \
rm -rf ./temp_grassdb
FROM base AS webapp
WORKDIR /r.avaflow/web-app
COPY . .
#15 Install Node.js and npm dependisies
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
cd /r.avaflow/web-app/server && npm i && \
cd /r.avaflow/web-app && npm i
#16 Expose ports for the web applications
EXPOSE 3000 4200
#17 Run Nest and Angular in development mode
CMD ["npm", "run", "start:dev"]