forked from OriginTrail/ot-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debian.Dockerfile
56 lines (33 loc) · 1.49 KB
/
Debian.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
#base image
FROM node:14.18.3-bullseye
MAINTAINER OriginTrail
LABEL maintainer="OriginTrail"
ENV NODE_ENV=testnet
#Mysql-server installation
ARG DEBIAN_FRONTEND=noninteractive
ARG PASSWORD=password
RUN apt-get update
RUN apt-get install -y lsb-release
RUN apt-get install -y wget gnupg curl
RUN curl -LO https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb
RUN dpkg -i ./mysql-apt-config_0.8.20-1_all.deb
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
RUN { \
echo mysql-server mysql-server/root_password password $PASSWORD ''; \
echo mysql-server mysql-server/root_password_again password $PASSWORD ''; \
} | debconf-set-selections \
&& apt-get update && apt-get install -y default-mysql-server default-mysql-server-core
RUN apt-get -qq -y install git
RUN apt-get -qq -y install make python
#Install Papertrail
RUN wget https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote_syslog_linux_amd64.tar.gz
RUN tar xzf ./remote_syslog_linux_amd64.tar.gz && cd remote_syslog && cp ./remote_syslog /usr/local/bin
COPY config/papertrail.yml /etc/log_files.yml
#Install nodemon & forever
RUN npm install forever -g
WORKDIR /ot-node
COPY . .
#Install nppm
RUN npm install
#Mysql intialization
RUN service mariadb start && mysql -u root -e "CREATE DATABASE operationaldb /*\!40100 DEFAULT CHARACTER SET utf8 */; SET PASSWORD FOR root@localhost = PASSWORD(''); FLUSH PRIVILEGES;" && npx sequelize --config=./config/sequelizeConfig.js db:migrate