From 680bc2ae49220d5bc6b7bce8adb487d766c32c1f Mon Sep 17 00:00:00 2001 From: WDaan Date: Thu, 18 Apr 2019 07:51:52 +0200 Subject: [PATCH] added Dockerfile + config for Vue --- .gitignore | 1 + Dockerfile | 15 +++++++++++++++ server/config/config.example.json | 3 ++- src/config/config.example.json | 8 ++++++++ src/services/qbit.js | 6 +++--- 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Dockerfile create mode 100644 src/config/config.example.json diff --git a/.gitignore b/.gitignore index e0ad59d6..f81fc71a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ yarn-error.log* #config files server/config/config.json +src/config/config.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..05946efb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:10-slim + +WORKDIR /app + +COPY package.json /app + +RUN npm install + +COPY server /app + +COPY dist /app + +EXPOSE 3009 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/server/config/config.example.json b/server/config/config.example.json index 782a3874..22f68733 100644 --- a/server/config/config.example.json +++ b/server/config/config.example.json @@ -3,5 +3,6 @@ "qbit_pass": "adminadmin", "qbit_host": "https://qbit.mydomain.com", "web_user": "username", - "web_pass": " password" + "web_pass": " password", + "web_host": "https://vuetr.mydomain.me" } diff --git a/src/config/config.example.json b/src/config/config.example.json new file mode 100644 index 00000000..22f68733 --- /dev/null +++ b/src/config/config.example.json @@ -0,0 +1,8 @@ +{ + "qbit_user": "admin", + "qbit_pass": "adminadmin", + "qbit_host": "https://qbit.mydomain.com", + "web_user": "username", + "web_pass": " password", + "web_host": "https://vuetr.mydomain.me" +} diff --git a/src/services/qbit.js b/src/services/qbit.js index 9fce091a..d292750a 100644 --- a/src/services/qbit.js +++ b/src/services/qbit.js @@ -1,11 +1,11 @@ -import {timingSafeEqual} from 'crypto'; - const axios = require('axios'); +const info = require('./config/config.json'); + class Qbit { constructor() { this._axios = axios.create({ - baseURL: 'http://localhost:3009', + baseURL: info.web_host, timeout: 1000 }); }