-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
93 lines (72 loc) · 2.66 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM ubuntu:22.04
USER root
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
RUN apt-get update && \
apt-get install -y dialog && \
apt-get install -y apt-utils && \
apt-get upgrade -y && \
apt-get install -y sudo
# other dependencies
RUN apt-get install -y build-essential && \
apt-get install -y python3 && \
apt-get install -y python3-pip && \
apt-get install -y wget && \
apt-get install -y git && \
apt-get install -y cmake && \
apt-get install -y automake && \
apt-get install -y libtool && \
apt-get install -y graphviz
# Lydia build dependencies
# CUDD
RUN wget https://github.com/whitemech/cudd/releases/download/v3.0.0/cudd_3.0.0_linux-amd64.tar.gz &&\
tar -xf cudd_3.0.0_linux-amd64.tar.gz &&\
cd cudd_3.0.0_linux-amd64 &&\
sudo cp -P lib/* /usr/local/lib/ &&\
sudo cp -Pr include/* /usr/local/include
# Flex & Bison & Graphviz
RUN apt-get install -y flex && \
apt-get install -y bison && \
apt-get install -y libgraphviz-dev
# MONA
RUN wget https://github.com/whitemech/MONA/releases/download/v1.4-19.dev0/mona_1.4-19.dev0_linux-amd64.tar.gz && \
tar -xf mona_1.4-19.dev0_linux-amd64.tar.gz && \
cd mona_1.4-19.dev0_linux-amd64 && \
sudo cp -P lib/* /usr/local/lib/ && \
sudo cp -Pr include/* /usr/local/include
# Syft
RUN wget https://github.com/whitemech/Syft/releases/download/v0.1.0/syft-3.0.0_ubuntu-20.04.tar.gz && \
tar -xf syft-3.0.0_ubuntu-20.04.tar.gz && \
cd syft-3.0.0_ubuntu-20.04 && \
sudo cp -P lib/* /usr/local/lib/
# Install Lydia binary
RUN wget https://github.com/whitemech/lydia/releases/download/v0.1.2/lydia &&\
sudo chmod u+x lydia &&\
cp lydia /usr/local/bin/lydia
# helper tools
RUN apt-get install -y curl && \
apt-get install -y gnupg
# install node
RUN curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh &&\
sudo bash nodesource_setup.sh
# install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt install -y yarn
RUN pip3 install gunicorn
RUN mkdir /server
RUN mkdir /client
COPY ./server /server
COPY ./client /client
ARG REACT_APP_API_ENDPOINT=/api/
ARG REACT_APP_API_HOSTNAME=localhost
RUN cd /client && yarn install
RUN cd /client && yarn build
WORKDIR /server
# TODO it takes too much time
# RUN cd lydia && rm -rf build && mkdir build && cd build &&\
# cmake -DCMAKE_BUILD_TYPE=Release .. &&\
# make lydia-bin &&\
# make install
RUN pip3 install .
CMD FLASK_STATIC_FOLDER=/client/build gunicorn --bind 0.0.0.0:$PORT wsgi