├── babel.config.js
├── dist
├── favicon.ico
├── favicon.ico.gz
├── index.html.gz
├── img
│ └── logo.82b9c7a5.png
├── js
│ ├── app.7eacab32.js.gz
│ ├── about.a274b4eb.js.gz
│ ├── about.a274b4eb.js.map.gz
│ ├── app.7eacab32.js.map.gz
│ ├── chunk-vendors.945fb921.js.gz
│ ├── chunk-vendors.945fb921.js.map.gz
│ ├── about.a274b4eb.js
│ ├── about.a274b4eb.js.map
│ ├── app.7eacab32.js
│ ├── app.7eacab32.js.map
│ └── chunk-vendors.945fb921.js
├── css
│ ├── app.3c0b035c.css.gz
│ └── app.3c0b035c.css
└── index.html
├── doc
└── Docker原理.pptx
├── public
├── favicon.ico
└── index.html
├── src
├── assets
│ └── logo.png
├── views
│ ├── About.vue
│ └── Home.vue
├── store.js
├── main.js
├── router.js
├── App.vue
└── components
│ └── HelloWorld.vue
├── Dockerfile
├── nginx
└── conf.d
│ └── default.conf
├── deploy.sh
├── .gitignore
├── README.md
├── vue.config.js
├── server.js
├── worker.js
├── package.json
├── webhooks.js
└── WechatEveryDay.memory-card.json
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/dist/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/favicon.ico
--------------------------------------------------------------------------------
/doc/Docker原理.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/doc/Docker原理.pptx
--------------------------------------------------------------------------------
/dist/favicon.ico.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/favicon.ico.gz
--------------------------------------------------------------------------------
/dist/index.html.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/index.html.gz
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/dist/img/logo.82b9c7a5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/img/logo.82b9c7a5.png
--------------------------------------------------------------------------------
/dist/js/app.7eacab32.js.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/app.7eacab32.js.gz
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:latest
2 | ADD ./dist /var/www/html
3 | ADD ./nginx/conf.d /etc/nginx/conf.d
4 | EXPOSE 80
--------------------------------------------------------------------------------
/dist/css/app.3c0b035c.css.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/css/app.3c0b035c.css.gz
--------------------------------------------------------------------------------
/dist/js/about.a274b4eb.js.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/about.a274b4eb.js.gz
--------------------------------------------------------------------------------
/dist/js/about.a274b4eb.js.map.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/about.a274b4eb.js.map.gz
--------------------------------------------------------------------------------
/dist/js/app.7eacab32.js.map.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/app.7eacab32.js.map.gz
--------------------------------------------------------------------------------
/dist/js/chunk-vendors.945fb921.js.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/chunk-vendors.945fb921.js.gz
--------------------------------------------------------------------------------
/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is an about page
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dist/js/chunk-vendors.945fb921.js.map.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hug-sun/vue-docker/HEAD/dist/js/chunk-vendors.945fb921.js.map.gz
--------------------------------------------------------------------------------
/src/store.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 |
4 | Vue.use(Vuex)
5 |
6 | export default new Vuex.Store({
7 | state: {
8 |
9 | },
10 | mutations: {
11 |
12 | },
13 | actions: {
14 |
15 | }
16 | })
17 |
--------------------------------------------------------------------------------
/nginx/conf.d/default.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 | # server_name www.shengxinjing.cn;
4 | location / {
5 | root /var/www/html;
6 | index index.html index.htm;
7 | # 支持vue的history
8 | try_files $uri $uri/ /index.html;
9 | }
10 | }
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #docker build -t kkb-frontend git@github.com:kkbjs/vue-docker.git
2 | # dist包在git李
3 | git pull
4 | docker build -t kkb-frontend-image .
5 | docker stop kkb-frontend-container
6 | docker rm kkb-frontend-container
7 | docker run -p 7001:80 -d --name kkb-frontend-container kkb-frontend-image
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 |
4 | # local env files
5 | .env.local
6 | .env.*.local
7 |
8 | # Log files
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 |
13 | # Editor directories and files
14 | .idea
15 | .vscode
16 | *.suo
17 | *.ntvs*
18 | *.njsproj
19 | *.sln
20 | *.sw?
21 |
--------------------------------------------------------------------------------
/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
19 |
--------------------------------------------------------------------------------
/dist/css/app.3c0b035c.css:
--------------------------------------------------------------------------------
1 | #app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}#nav{padding:30px}#nav a{font-weight:700;color:#2c3e50}#nav a.router-link-exact-active{color:#42b983}h3[data-v-b9167eee]{margin:40px 0 0}ul[data-v-b9167eee]{list-style-type:none;padding:0}li[data-v-b9167eee]{display:inline-block;margin:0 10px}a[data-v-b9167eee]{color:#42b983}
--------------------------------------------------------------------------------
/dist/js/about.a274b4eb.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["about"],{f820:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},s=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"about"},[n("h1",[t._v("This is an about page")])])}],c=n("17cc"),u={},i=Object(c["a"])(u,a,s,!1,null,null,null);e["default"]=i.exports}}]);
2 | //# sourceMappingURL=about.a274b4eb.js.map
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-docker
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Run your tests
19 | ```
20 | npm run test
21 | ```
22 |
23 | ### Lints and fixes files
24 | ```
25 | npm run lint
26 | ```
27 |
28 | ### Customize configuration
29 | See [Configuration Reference](https://cli.vuejs.org/config/).
30 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | vue-docker
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import store from './store'
5 |
6 | Vue.config.productionTip = false
7 |
8 | // 很普通的独享
9 | let obj = {
10 | name : 'kaikeba'
11 | }
12 | // let obj = {
13 | // name:'xx'
14 | // }
15 |
16 | const property = Object.getOwnPropertyDescriptor(obj, 'name')
17 | console.log( property.configurable)
18 |
19 | Object.freeze(obj)
20 |
21 | const property1 = Object.getOwnPropertyDescriptor(obj, 'name')
22 | console.log( property1.configurable)
23 |
24 | new Vue({
25 | router,
26 | store,
27 | render: h => h(App)
28 | }).$mount('#app')
29 |
--------------------------------------------------------------------------------
/src/router.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | import Home from './views/Home.vue'
4 |
5 | Vue.use(Router)
6 |
7 | export default new Router({
8 | mode: 'history',
9 | base: process.env.BASE_URL,
10 | routes: [
11 | {
12 | path: '/',
13 | name: 'home',
14 | component: Home
15 | },
16 | {
17 | path: '/about',
18 | name: 'about',
19 | // route level code-splitting
20 | // this generates a separate chunk (about.[hash].js) for this route
21 | // which is lazy-loaded when the route is visited.
22 | component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
23 | }
24 | ]
25 | })
26 |
--------------------------------------------------------------------------------
/dist/index.html:
--------------------------------------------------------------------------------
1 | vue-docker
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Docker部署测试一下 - @deploy 哈哈
4 |
5 |
6 |
7 |
再次部署
8 |
9 | commit信息中带上@deploy 我们就自动部署docker
10 |
11 |
12 |
13 | Home |
14 | About
15 |
16 |
17 |
18 |
19 |
20 |
41 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | // vue.config.js
2 | const CompressionPlugin = require('compression-webpack-plugin')
3 | module.exports = {
4 | chainWebpack: config => {
5 | // 这里是对环境的配置,不同环境对应不同的BASE_URL,以便axios的请求地址不同
6 | config.plugin('define').tap(args => {
7 | args[0]['process.env'].BASE_URL = JSON.stringify(process.env.BASE_URL)
8 | return args
9 | })
10 | if (process.env.NODE_ENV === 'production') {
11 | // #region 启用GZip压缩
12 | config
13 | .plugin('compression')
14 | .use(CompressionPlugin, {
15 | asset: '[path].gz[query]',
16 | algorithm: 'gzip',
17 | test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
18 | threshold: 10240,
19 | minRatio: 0.8,
20 | cache: true
21 | })
22 | .tap(args => { })
23 |
24 | // #endregion
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | // const express = require('express')
2 | // const app = express()
3 |
4 | // app.get('/',function(req,res){
5 | // res.send(`
6 | //
7 | //
8 | //
9 | //
开课吧
10 | //
开课吧还不错
11 | //
12 | //
13 | //