Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build new docker-tm-db-testing image #43

Merged
merged 4 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ami-tm-web-backend/backend.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Description=TM Web Backend
Requires=network-online.target
After=network-online.target

[Service]
Type=exec
User=backend
Group=backend
Restart=on-failure
WorkingDirectory=/home/backend/backend
PermissionsStartOnly=true
Environment=PORT=39206
ExecStart=/usr/bin/npm run start
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target
15 changes: 14 additions & 1 deletion ami-tm-web-backend/install_backend.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
#!/usr/bin/bash -xe
#!/bin/bash -xe

git clone https://github.com/tendermint/backend.git

cd backend

npm install

cd ..

sudo mv backend /home/backend
sudo chown -R backend:backend /home/backend/backend

sudo mv /tmp/backend.service /lib/systemd/system/backend.service
sudo systemctl enable backend
18 changes: 18 additions & 0 deletions ami-tm-web-backend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/

user backend;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
Expand Down Expand Up @@ -53,6 +54,8 @@ http {
proxy_pass https://medium.com/feed/cosmos-blockchain;
}



error_page 404 /404.html;
location = /40x.html {
}
Expand All @@ -65,5 +68,20 @@ http {
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
}

server {
listen 80;
listen [::]:80;
server_name blogrss.cosmos.network;

location / {
server_tokens off;

proxy_redirect off;
proxy_set_header x-forwarded-for $remote_addr;
proxy_set_header host $http_host;
proxy_pass https://localhost:39206;
}
}
}

12 changes: 11 additions & 1 deletion ami-tm-web-backend/tm-web-backend.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@
"sudo mv /tmp/nginx.conf /etc/nginx/nginx.conf",
"sudo systemctl enable nginx",
"curl -sL https://deb.nodesource.com/setup_{{ user `node_version` }} | sudo -E bash -",
"sudo apt-get -y install nodejs"
"sudo apt-get -y install nodejs",
"sudo useradd -m backend"
]
},
{
"type": "file",
"source": "backend.service",
"destination": "/tmp/backend.service"
},
{
"type": "shell",
"script": "install_backend.sh"
}
]
}
4 changes: 2 additions & 2 deletions docker-protoc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:18.04

ENV PROTOC_VERSION=3.11.2
ENV GO_VERSION=1.13.5
ENV BUF_VERSION=0.5.0
ENV GO_VERSION=1.13.7
erikgrinaker marked this conversation as resolved.
Show resolved Hide resolved
ENV BUF_VERSION=0.7.0
ENV PATH="${PATH}:/usr/local/go/bin:/root/go/bin"
ENV BIN="/usr/local/bin"

Expand Down
31 changes: 24 additions & 7 deletions docker-tm-db-testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
FROM circleci/golang

RUN sudo apt-get install -y --no-install-recommends libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev
ENV LD_LIBRARY_PATH=/usr/local/lib

RUN sudo apt-get install -y --no-install-recommends \
libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev

# Install cleveldb
RUN wget https://github.com/google/leveldb/archive/v1.20.tar.gz && tar xvf v1.20.tar.gz && rm -f v1.22.tar.gz
RUN cd leveldb-1.20 && make && sudo scp -r out-static/lib* out-shared/lib* "/usr/local/lib" && cd include && sudo scp -r leveldb /usr/local/include && sudo ldconfig && cd ~
RUN \
wget https://github.com/google/leveldb/archive/v1.20.tar.gz \
&& tar xvf v1.20.tar.gz \
&& cd leveldb-1.20 \
&& make \
&& sudo cp -a out-static/lib* out-shared/lib* /usr/local/lib \
&& cd include \
&& sudo cp -a leveldb /usr/local/include \
&& sudo ldconfig \
&& cd ../.. \
&& rm -rf v1.20.tar.gz leveldb-1.20

# Install Rocksdb
RUN git clone https://github.com/facebook/rocksdb.git && cd rocksdb/ && sudo make install

# Install boltdb
RUN go get go.etcd.io/bbolt/...
RUN \
wget https://github.com/facebook/rocksdb/archive/v6.6.4.tar.gz \
&& tar -zxf v6.6.4.tar.gz \
&& cd rocksdb-6.6.4 \
&& DEBUG_LEVEL=0 make -j4 shared_lib \
&& sudo make install-shared \
&& sudo ldconfig \
&& cd .. \
&& rm -rf v6.6.4.tar.gz rocksdb-6.6.4