Update ENV_VARIABLES in scripts && Fix some errors

This commit is contained in:
Bastien 2021-02-02 17:54:01 +01:00
parent 6efe055003
commit 91d4017aa6
4 changed files with 18 additions and 17 deletions

View File

@ -5,15 +5,12 @@ COPY . .
RUN apt-get update
RUN apt-get install -y build-essential python3 pkg-config
RUN npm ci --production
RUN npm i typescript
RUN npm run build
FROM node:12-buster-slim
WORKDIR /backend
RUN mkdir cache
COPY --from=builder /build/ .
RUN chmod +x /backend/start.sh

View File

@ -1,16 +1,21 @@
#!/bin/sh
__BITCOIN_MAINNET_RPC_HOST__=${RPC_HOST}
__BITCOIN_MAINNET_RPC_PORT__=${RPC_PORT}
__BITCOIN_MAINNET_RPC_USER__=${RPC_USER}
__BITCOIN_MAINNET_RPC_PASS__=${RPC_PASS}
__ELECTRS_MAINNET_HTTP_HOST__=${ELECTRS_HOST}
__ELECTRS_MAINNET_HTTP_PORT__=${ELECTRS_PORT}
__MYSQL_HOST__=${MYSQL_HOST}
__MYSQL_PORT__=${MYSQL_PORT}
__MEMPOOL_BACKEND_CACHE_DIR__=${CACHE_DIR}
__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__=${BACKEND_MAINNET_HTTP_HOST}
__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__=${BACKEND_MAINNET_HTTP_PORT}
#MEMPOOL
__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__=${BACKEND_MAINNET_HTTP_PORT:=8999}
__MEMPOOL_BACKEND_CACHE_DIR__=${CACHE_DIR:=/backend/cache}
# BITCOIN
__BITCOIN_MAINNET_RPC_HOST__=${RPC_HOST:=127.0.0.1}
__BITCOIN_MAINNET_RPC_PORT__=${RPC_PORT:=8332}
__BITCOIN_MAINNET_RPC_USER__=${RPC_USER:=mempool}
__BITCOIN_MAINNET_RPC_PASS__=${RPC_PASS:=mempool}
# ELECTRUM
__ELECTRS_MAINNET_HTTP_HOST__=${ELECTRS_HOST:=127.0.0.1}
__ELECTRS_MAINNET_HTTP_PORT__=${ELECTRS_PORT:=50002}
# MYSQL
__MYSQL_HOST__=${MYSQL_HOST:=127.0.0.1}
__MYSQL_PORT__=${MYSQL_PORT:=3306}
mkdir __MEMPOOL_BACKEND_CACHE_DIR__
sed -i "s/__BITCOIN_MAINNET_RPC_HOST__/${__BITCOIN_MAINNET_RPC_HOST__}/g" mempool-config.json
sed -i "s/__BITCOIN_MAINNET_RPC_PORT__/${__BITCOIN_MAINNET_RPC_PORT__}/g" mempool-config.json
@ -22,6 +27,5 @@ sed -i "s/__MYSQL_HOST__/${__MYSQL_HOST__}/g" mempool-config.json
sed -i "s/__MYSQL_PORT__/${__MYSQL_PORT__}/g" mempool-config.json
sed -i "s/__MEMPOOL_BACKEND_CACHE_DIR__/${__MEMPOOL_BACKEND_CACHE_DIR__}/g" mempool-config.json
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_PORT__/${__MEMPOOL_BACKEND_MAINNET_HTTP_PORT_}/g" mempool-config.json
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__/${__MEMPOOL_BACKEND_MAINNET_HTTP_HOST_}/g" mempool-config.json
node /backend/dist/index.js

View File

@ -1,5 +1,5 @@
#!/bin/sh
__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__=${BACKEND_MAINNET_HTTP_HOST}
__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__=${BACKEND_MAINNET_HTTP_HOST:=127.0.0.1}
sed -i "s/__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__/${__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__}/g" /etc/nginx/conf.d/nginx-mempool.conf

View File

@ -15,7 +15,7 @@ sed -i "s/${localhostIP}:/0.0.0.0:80/g" ./frontend/nginx.conf
sed -i "s/${localhostIP}/0.0.0.0/g" ./frontend/nginx.conf
sed -i "s/user nobody;//g" ./frontend/nginx.conf
sed -i "s!/etc/nginx/nginx-mempool.conf!/etc/nginx/conf.d/nginx-mempool.conf!g" ./frontend/nginx.conf
sed -i "s/${localhostIP}:/__MEMPOOL_MAINNET_BACKEND_HOST__:/g" ./frontend/nginx-mempool.conf
sed -i "s/${localhostIP}:/__MEMPOOL_BACKEND_MAINNET_HTTP_HOST__:/g" ./frontend/nginx-mempool.conf
#db
cp -fr docker/mysql .