update dockerfile

This commit is contained in:
smart_ex 2022-07-04 21:56:05 +10:00
parent 5de52850b5
commit 4edf32a76e
5 changed files with 16 additions and 10 deletions

@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 16
- run: yarn install --skip-integrity-check
- run: yarn install --network-concurrency=2
# - run: yarn test
- run: yarn lint
- name: Telegram Failure Notification

@ -7,7 +7,7 @@ WORKDIR /usr/app
COPY yarn.lock .
COPY package.json .
RUN apk update && apk add --no-cache g++ make python3 git openssh && rm -rf /var/cache/apk/*
RUN yarn install
RUN yarn install --network-concurrency 2
COPY . ./
RUN yarn build
@ -23,5 +23,6 @@ COPY --from=dev /usr/app/build /app
COPY --from=dev /usr/app/package.json /app/
COPY --from=dev /usr/app/yarn.lock /app/
RUN yarn install && yarn cache clean -f
RUN yarn install --network-concurrency 2 && yarn cache clean -f
ENTRYPOINT ["yarn"]

@ -3,9 +3,9 @@
"version": "5.0.0",
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
"scripts": {
"server": "node app/index.js",
"txWorker": "node txWorker.js",
"healthWorker": "node healthWorker.js",
"server": "node src/app/index.js",
"txWorker": "node src/txWorker.js",
"healthWorker": "node src/healthWorker.js",
"dev:server": "nodemon --watch './src/**/*.ts' --exec ts-node src/app/index.ts",
"dev:healthWorker": "nodemon --watch './src/**/*.ts' --exec ts-node src/healthWorker.ts",
"dev:txWorker": "nodemon --watch './src/**/*.ts' --exec ts-node src/txWorker.ts",

@ -1,9 +1,11 @@
import { RelayerJobType } from './types';
import tornConfig, { availableIds } from 'torn-token';
import { config } from 'dotenv';
import { version } from '../package.json';
require('dotenv').config();
config();
const isProduction = process.env.NODE_ENV === 'production';
export const relayerVersion = require(`${isProduction ? '.' : '..'}/package.json`).version;
export const relayerVersion = version;
export const netId = <availableIds>Number(process.env.NET_ID || 1);
export const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379';
export const rpcUrl = process.env.HTTP_RPC_URL;

@ -36,7 +36,10 @@ export class HealthService {
private async _getStatus() {
const status = await this.store.client.hgetall('health:status');
return status || { health: 'false', error: 'Service is not running' };
if (Object.keys(status).length === 0) {
return { health: 'false', error: 'Service is not running' };
}
return status;
}
private static _parseSet(log, to = 'array', keys = ['message', 'score']) {
@ -64,7 +67,7 @@ export class HealthService {
async getStatus() {
const { errorsLog, errorsCode } = await this._getErrors();
if (errorsCode['NETWORK_ERROR'] > 6) {
if (errorsCode['NETWORK_ERROR'] > 10) {
await this.setStatus({ status: false, error: 'Network error' });
}
const heathStatus = await this._getStatus();