调整docker配置,使用Nginx做web服务器

pull/1/head
pnoker 6 years ago
parent 4474093bbe
commit 7868bdcd9e

@ -14,19 +14,9 @@
# limitations under the License. # limitations under the License.
# #
FROM node:12.14 FROM nginx:1.17.6
MAINTAINER pnoker pnokers.icloud.com MAINTAINER pnoker pnokers.icloud.com
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ 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" ]
COPY ./dist/ /usr/share/nginx/html/

@ -8,7 +8,7 @@ services:
image: pnoker/dc3-web:3.0 image: pnoker/dc3-web:3.0
restart: always restart: always
ports: ports:
- 3000:3000 - 3000:80
container_name: dc3.web container_name: dc3.web
hostname: dc3.web hostname: dc3.web
networks: networks:
@ -18,5 +18,5 @@ services:
networks: networks:
dc3net: dc3net:
driver: 'overlay' driver: 'bridge'
... ...

@ -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;

@ -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;
}

@ -1,12 +0,0 @@
{
"name": "express",
"author": "pnoker",
"private": true,
"description": "IOT DC3 平台 WEB",
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"express": "~4.16.1"
}
}

@ -9,27 +9,28 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.1",
"core-js": "^3.3.2", "core-js": "^3.6.2",
"element-ui": "^2.4.5", "echarts": "^4.6.0",
"vue": "^2.6.10", "element-ui": "^2.13.0",
"vue": "^2.6.11",
"vue-axios": "^2.1.5", "vue-axios": "^2.1.5",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.0.1" "vuex": "^3.1.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.0.0", "@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-eslint": "^4.0.0", "@vue/cli-plugin-eslint": "^4.1.2",
"@vue/cli-plugin-router": "^4.0.5", "@vue/cli-plugin-router": "^4.1.2",
"@vue/cli-plugin-vuex": "^4.0.5", "@vue/cli-plugin-vuex": "^4.1.2",
"@vue/cli-service": "^4.0.0", "@vue/cli-service": "^4.1.2",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"eslint": "^5.5.0", "eslint": "^6.8.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^6.1.2",
"node-sass": "^4.9.2", "node-sass": "^4.13.0",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1", "vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.11"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

@ -3,7 +3,7 @@ import App from './App.vue'
import router from './router/router' import router from './router/router'
import store from './store/store' import store from './store/store'
//Element UI //Element UI
import './plugins/element.js' import './plugins/element/element.js'
//Axios //Axios
import axios from 'axios' import axios from 'axios'
import VueAxios from 'vue-axios' import VueAxios from 'vue-axios'

@ -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"
}
}

@ -1,5 +1,4 @@
module.exports = { module.exports = {
publicPath: './', publicPath: './',
outputDir: 'express/public',
productionSourceMap: false productionSourceMap: false
} }
Loading…
Cancel
Save