Skip to content

Commit

Permalink
Merge pull request #38 from terwer/v4.x
Browse files Browse the repository at this point in the history
Build complete
  • Loading branch information
terwer committed Mar 15, 2019
2 parents 5ce05b2 + 33710b7 commit f509e78
Show file tree
Hide file tree
Showing 49 changed files with 951 additions and 3 deletions.
28 changes: 28 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,32 @@ services:
- ./jvue-server:/app
- ./data/maven/.m2:/root/.m2
- ./data/server/logs:/logs
restart: always
jvue-front:
privileged: true
container_name: jvue-front
image: jvue-front:4.0.0
build:
context: .
dockerfile: ./jvue-front/Dockerfile
ports:
- "3000:3000"
environment:
- npm_config_unsafe_perm=true
# 这里的命令优先级比较高,会自动覆盖镜像里面的命令
command: npm run serve
restart: always
jvue-admin:
privileged: true
container_name: jvue-admin
image: jvue-admin:4.0.0
build:
context: .
dockerfile: ./jvue-admin/Dockerfile
ports:
- "3001:3001"
environment:
- npm_config_unsafe_perm=true
# 这里的命令优先级比较高,会自动覆盖镜像里面的命令
command: npm run serve
restart: always
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,31 @@ services:
- ./data/maven/.m2:/root/.m2
- ./data/server/logs:/logs
restart: always
jvue-front:
privileged: true
container_name: jvue-front
image: jvue-front:4.0.0
build:
context: .
dockerfile: ./jvue-front/Dockerfile
ports:
- "3000:3000"
environment:
- npm_config_unsafe_perm=true
# 这里的命令优先级比较高,会自动覆盖镜像里面的命令
command: npm run serve
restart: always
jvue-admin:
privileged: true
container_name: jvue-admin
image: jvue-admin:4.0.0
build:
context: .
dockerfile: ./jvue-admin/Dockerfile
ports:
- "3001:3001"
environment:
- npm_config_unsafe_perm=true
# 这里的命令优先级比较高,会自动覆盖镜像里面的命令
command: npm run serve
restart: always
3 changes: 3 additions & 0 deletions jvue-admin/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
14 changes: 14 additions & 0 deletions jvue-admin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
parserOptions: {
parser: "babel-eslint"
}
};
24 changes: 24 additions & 0 deletions jvue-admin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.DS_Store
node_modules
/dist

/tests/e2e/reports/
selenium-debug.log

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
21 changes: 21 additions & 0 deletions jvue-admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#依赖的镜像
FROM node:10.15.1-alpine

# CDN注册
RUN npm config set registry https://registry.npm.taobao.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm cache clean --force

# 工作目录
WORKDIR /app

# 安装依赖
COPY ./jvue-admin/package.json ./
RUN npm install

# 注意这个一定要要在npm install后面,否则devDependencies的包无法安装
ENV HOST 0.0.0.0

COPY ./jvue-admin .

CMD ["npm", "run", "serve"]
39 changes: 39 additions & 0 deletions jvue-admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# jvue-admin

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Run your tests
```
yarn run test
```

### Lints and fixes files
```
yarn run lint
```

### Run your end-to-end tests
```
yarn run test:e2e
```

### Run your unit tests
```
yarn run test:unit
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
3 changes: 3 additions & 0 deletions jvue-admin/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/app"]
};
18 changes: 18 additions & 0 deletions jvue-admin/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
moduleFileExtensions: ["js", "jsx", "json", "vue"],
transform: {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub",
"^.+\\.jsx?$": "babel-jest"
},
transformIgnorePatterns: ["/node_modules/"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
},
snapshotSerializers: ["jest-serializer-vue"],
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
testURL: "http://localhost/"
};
34 changes: 34 additions & 0 deletions jvue-admin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "jvue-admin",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --port 3001",
"start": "vue-cli-service serve --port 3001 --mode production",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"vue": "^2.6.6",
"vue-router": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.5.0",
"@vue/cli-plugin-e2e-nightwatch": "^3.5.0",
"@vue/cli-plugin-eslint": "^3.5.0",
"@vue/cli-plugin-unit-jest": "^3.5.0",
"@vue/cli-service": "^3.5.0",
"@vue/eslint-config-prettier": "^4.0.1",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.5.21"
}
}
5 changes: 5 additions & 0 deletions jvue-admin/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
};
Binary file added jvue-admin/public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions jvue-admin/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>jvue-admin</title>
</head>
<body>
<noscript>
<strong>We're sorry but jvue-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
29 changes: 29 additions & 0 deletions jvue-admin/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view />
</div>
</template>

<style lang="scss">
#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;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
</style>
Binary file added jvue-admin/src/assets/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f509e78

Please sign in to comment.