From 7868bdcd9e5a99817764cb107c9376fd0d71ca21 Mon Sep 17 00:00:00 2001 From: pnoker Date: Wed, 8 Jan 2020 16:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4docker=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8Nginx=E5=81=9Aweb=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dc3/Dockerfile | 16 +- dc3/docker-compose.yml | 4 +- express/app.js | 9 - express/bin/www | 47 ----- express/package.json | 12 -- package.json | 29 +-- src/main.js | 2 +- src/plugins/echart/macarons.project.json | 180 ++++++++++++++++++ .../{ => element}/element-variables.scss | 0 src/plugins/{ => element}/element.js | 0 vue.config.js | 1 - 11 files changed, 201 insertions(+), 99 deletions(-) delete mode 100644 express/app.js delete mode 100644 express/bin/www delete mode 100644 express/package.json create mode 100644 src/plugins/echart/macarons.project.json rename src/plugins/{ => element}/element-variables.scss (100%) rename src/plugins/{ => element}/element.js (100%) diff --git a/dc3/Dockerfile b/dc3/Dockerfile index 42e1ec2..c5ac6fe 100644 --- a/dc3/Dockerfile +++ b/dc3/Dockerfile @@ -14,19 +14,9 @@ # limitations under the License. # -FROM node:12.14 +FROM nginx:1.17.6 MAINTAINER pnoker pnokers.icloud.com -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && mkdir -p /dc3-web - -WORKDIR /dc3-web - -ADD ./express ./ - -RUN npm install - -EXPOSE 3000 - -CMD [ "node", "./bin/www" ] +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +COPY ./dist/ /usr/share/nginx/html/ \ No newline at end of file diff --git a/dc3/docker-compose.yml b/dc3/docker-compose.yml index 38e1e59..f3d62c5 100644 --- a/dc3/docker-compose.yml +++ b/dc3/docker-compose.yml @@ -8,7 +8,7 @@ services: image: pnoker/dc3-web:3.0 restart: always ports: - - 3000:3000 + - 3000:80 container_name: dc3.web hostname: dc3.web networks: @@ -18,5 +18,5 @@ services: networks: dc3net: - driver: 'overlay' + driver: 'bridge' ... diff --git a/express/app.js b/express/app.js deleted file mode 100644 index f38b8d1..0000000 --- a/express/app.js +++ /dev/null @@ -1,9 +0,0 @@ -const express = require('express'); -const path = require('path'); -const app = express(); - -app.use(express.json()); -app.use(express.urlencoded({extended: false})); -app.use(express.static(path.join(__dirname, 'public'))); - -module.exports = app; diff --git a/express/bin/www b/express/bin/www deleted file mode 100644 index f45a161..0000000 --- a/express/bin/www +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -const app = require('../app'); -const http = require('http'); - -/** - * Get port from environment and store in Express. - */ - -const port = normalizePort(process.env.PORT || '3000'); -app.set('port', port); - -/** - * Create HTTP server. - */ - -const server = http.createServer(app); - -/** - * Listen on provided port, on all network interfaces. - */ - -server.listen(port); - -/** - * Normalize a port into a number, string, or false. - */ - -function normalizePort(val) { - const port = parseInt(val, 10); - - if (isNaN(port)) { - // named pipe - return val; - } - - if (port >= 0) { - // port number - return port; - } - - return false; -} \ No newline at end of file diff --git a/express/package.json b/express/package.json deleted file mode 100644 index 8a1493d..0000000 --- a/express/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "express", - "author": "pnoker", - "private": true, - "description": "IOT DC3 平台 WEB", - "scripts": { - "start": "node ./bin/www" - }, - "dependencies": { - "express": "~4.16.1" - } -} diff --git a/package.json b/package.json index 65d1761..27f70d9 100644 --- a/package.json +++ b/package.json @@ -9,27 +9,28 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "axios": "^0.19.0", - "core-js": "^3.3.2", - "element-ui": "^2.4.5", - "vue": "^2.6.10", + "axios": "^0.19.1", + "core-js": "^3.6.2", + "echarts": "^4.6.0", + "element-ui": "^2.13.0", + "vue": "^2.6.11", "vue-axios": "^2.1.5", "vue-router": "^3.1.3", - "vuex": "^3.0.1" + "vuex": "^3.1.2" }, "devDependencies": { - "@vue/cli-plugin-babel": "^4.0.0", - "@vue/cli-plugin-eslint": "^4.0.0", - "@vue/cli-plugin-router": "^4.0.5", - "@vue/cli-plugin-vuex": "^4.0.5", - "@vue/cli-service": "^4.0.0", + "@vue/cli-plugin-babel": "^4.1.2", + "@vue/cli-plugin-eslint": "^4.1.2", + "@vue/cli-plugin-router": "^4.1.2", + "@vue/cli-plugin-vuex": "^4.1.2", + "@vue/cli-service": "^4.1.2", "babel-eslint": "^10.0.3", - "eslint": "^5.5.0", - "eslint-plugin-vue": "^5.0.0", - "node-sass": "^4.9.2", + "eslint": "^6.8.0", + "eslint-plugin-vue": "^6.1.2", + "node-sass": "^4.13.0", "sass-loader": "^8.0.0", "vue-cli-plugin-element": "^1.0.1", - "vue-template-compiler": "^2.6.10" + "vue-template-compiler": "^2.6.11" }, "eslintConfig": { "root": true, diff --git a/src/main.js b/src/main.js index cae10e0..ab41fae 100644 --- a/src/main.js +++ b/src/main.js @@ -3,7 +3,7 @@ import App from './App.vue' import router from './router/router' import store from './store/store' //Element UI -import './plugins/element.js' +import './plugins/element/element.js' //Axios import axios from 'axios' import VueAxios from 'vue-axios' diff --git a/src/plugins/echart/macarons.project.json b/src/plugins/echart/macarons.project.json new file mode 100644 index 0000000..7f4502a --- /dev/null +++ b/src/plugins/echart/macarons.project.json @@ -0,0 +1,180 @@ +{ + "version": 1, + "themeName": "macarons", + "theme": { + "seriesCnt": "4", + "backgroundColor": "rgba(0,0,0,0)", + "titleColor": "#008acd", + "subtitleColor": "#aaaaaa", + "textColorShow": false, + "textColor": "#333", + "markTextColor": "#eeeeee", + "color": [ + "#2ec7c9", + "#b6a2de", + "#5ab1ef", + "#ffb980", + "#d87a80", + "#8d98b3", + "#e5cf0d", + "#97b552", + "#95706d", + "#dc69aa", + "#07a2a4", + "#9a7fd1", + "#588dd5", + "#f5994e", + "#c05050", + "#59678c", + "#c9ab00", + "#7eb00a", + "#6f5553", + "#c14089" + ], + "borderColor": "#ccc", + "borderWidth": 0, + "visualMapColor": [ + "#5ab1ef", + "#e0ffff" + ], + "legendTextColor": "#333333", + "kColor": "#d87a80", + "kColor0": "#2ec7c9", + "kBorderColor": "#d87a80", + "kBorderColor0": "#2ec7c9", + "kBorderWidth": 1, + "lineWidth": 2, + "symbolSize": 3, + "symbol": "emptyCircle", + "symbolBorderWidth": 1, + "lineSmooth": true, + "graphLineWidth": 1, + "graphLineColor": "#aaaaaa", + "mapLabelColor": "#d87a80", + "mapLabelColorE": "rgb(100,0,0)", + "mapBorderColor": "#eeeeee", + "mapBorderColorE": "#444444", + "mapBorderWidth": 0.5, + "mapBorderWidthE": 1, + "mapAreaColor": "#dddddd", + "mapAreaColorE": "rgba(254,153,78,1)", + "axes": [ + { + "type": "all", + "name": "通用坐标轴", + "axisLineShow": true, + "axisLineColor": "#eeeeee", + "axisTickShow": true, + "axisTickColor": "#eeeeee", + "axisLabelShow": true, + "axisLabelColor": "#eeeeee", + "splitLineShow": true, + "splitLineColor": [ + "#aaaaaa" + ], + "splitAreaShow": false, + "splitAreaColor": [ + "#eeeeee" + ] + }, + { + "type": "category", + "name": "类目坐标轴", + "axisLineShow": true, + "axisLineColor": "#008acd", + "axisTickShow": true, + "axisTickColor": "#333", + "axisLabelShow": true, + "axisLabelColor": "#333", + "splitLineShow": false, + "splitLineColor": [ + "#eee" + ], + "splitAreaShow": false, + "splitAreaColor": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + }, + { + "type": "value", + "name": "数值坐标轴", + "axisLineShow": true, + "axisLineColor": "#008acd", + "axisTickShow": true, + "axisTickColor": "#333", + "axisLabelShow": true, + "axisLabelColor": "#333", + "splitLineShow": true, + "splitLineColor": [ + "#eee" + ], + "splitAreaShow": true, + "splitAreaColor": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + }, + { + "type": "log", + "name": "对数坐标轴", + "axisLineShow": true, + "axisLineColor": "#008acd", + "axisTickShow": true, + "axisTickColor": "#333", + "axisLabelShow": true, + "axisLabelColor": "#333", + "splitLineShow": true, + "splitLineColor": [ + "#eee" + ], + "splitAreaShow": true, + "splitAreaColor": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + }, + { + "type": "time", + "name": "时间坐标轴", + "axisLineShow": true, + "axisLineColor": "#008acd", + "axisTickShow": true, + "axisTickColor": "#333", + "axisLabelShow": true, + "axisLabelColor": "#333", + "splitLineShow": true, + "splitLineColor": [ + "#eee" + ], + "splitAreaShow": false, + "splitAreaColor": [ + "rgba(250,250,250,0.3)", + "rgba(200,200,200,0.3)" + ] + } + ], + "axisSeperateSetting": true, + "toolboxColor": "#2ec7c9", + "toolboxEmpasisColor": "#18a4a6", + "tooltipAxisColor": "#008acd", + "tooltipAxisWidth": "1", + "timelineLineColor": "#008acd", + "timelineLineWidth": 1, + "timelineItemColor": "#008acd", + "timelineItemColorE": "#a9334c", + "timelineCheckColor": "#2ec7c9", + "timelineCheckBorderColor": "rgba(46,199,201,0.4)", + "timelineItemBorderWidth": 1, + "timelineControlColor": "#008acd", + "timelineControlBorderColor": "#008acd", + "timelineControlBorderWidth": 0.5, + "timelineLabelColor": "#008acd", + "datazoomBackgroundColor": "rgba(47,69,84,0)", + "datazoomDataColor": "rgba(239,239,255,1)", + "datazoomFillColor": "rgba(182,162,222,0.2)", + "datazoomHandleColor": "#008acd", + "datazoomHandleWidth": "100", + "datazoomLabelColor": "#333333" + } +} \ No newline at end of file diff --git a/src/plugins/element-variables.scss b/src/plugins/element/element-variables.scss similarity index 100% rename from src/plugins/element-variables.scss rename to src/plugins/element/element-variables.scss diff --git a/src/plugins/element.js b/src/plugins/element/element.js similarity index 100% rename from src/plugins/element.js rename to src/plugins/element/element.js diff --git a/vue.config.js b/vue.config.js index c3cc766..629fb3b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,4 @@ module.exports = { publicPath: './', - outputDir: 'express/public', productionSourceMap: false } \ No newline at end of file