-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
67 lines (47 loc) · 1.43 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
FROM ubuntu:20.04 as restful4up
# HTTP port
ARG HTTP_PORT
# Working directory
ARG WORK_DIR=/opt/restful4up
# App folder path
ARG APP_FOLDER_PATH_ZIP=$WORK_DIR/zips
ARG APP_FOLDER_PATH_EXEC=$WORK_DIR/executables
WORKDIR ${WORK_DIR}
RUN apt-get update
# Installing essentials
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN apt-get -y install unzip
RUN apt-get -y install python3-pip
RUN apt-get -y install curl
RUN apt-get -y install build-essential
RUN apt-get -y install wget
# Installing NodeJs and yarn
RUN apt-get -y install nodejs
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update
RUN apt-get -y install nodejs
RUN apt-get -y install yarn
# Unipacker
RUN pip3 install --upgrade unipacker
# PEV tools
RUN apt-get -y install pev
# YARA
RUN apt-get -y install yara
RUN apt-get -y install yara-doc
# Testing YARA
RUN echo rule dummy { condition: true } > my_first_rule
RUN yara my_first_rule my_first_rule
# Set environment variables
ENV PATH="$HOME/.local/bin:$HOME/${APP_FOLDER_PATH_EXEC}:$PATH"
ENV HTTP_PORT=$HTTP_PORT
EXPOSE ${HTTP_PORT}
ENV HTTP_PORT ${HTTP_PORT}
# Copy source code
COPY ./app .
RUN yarn install --forzen-lockfile
RUN yarn build
# Setting up proper environment
ENV NODE_ENV=production
CMD [ "yarn", "start" ]