Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.2.0 #198

Merged
merged 5 commits into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 19 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,82 +21,64 @@
Next light-weight,responsive project
With Docker,Vue2,Vue CLI 3,webpack4,Java8 and Spring Boot5

# Important Changes in JVue 4
## Important Changes in JVue 4

Using [Docker](https://docs.docker.com/develop/dev-best-practices/) for deploy

# Install
## Install
The instructions assume that you have already installed [Docker](https://docs.docker.com/installation/) and [Docker Compose](https://docs.docker.com/compose/install/).

# Run
## Run

## install docker
### install docker
```
yum install docker
```

## install docker-compose
### install docker-compose
```
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
```

See [https://docs.docker.com/compose/reference/up/](https://docs.docker.com/compose/reference/up/)

## run jvue
## Run jvue

### via docker(for production)
### docker(for dev)

```bash
docker compose up -d --build
docker compose up --build
```

### custom(for dev)
~~1. mysql~~
### docker(for production)

```bash
docker compose -f docker-compose-mysql.yml
docker compose up -d --build
```

2. Jvue-server
### dev

1. jvue-mysql

2. jvue-server

```bash
cd ./jvue-server/src/main/java/com/terwergreen/jvueserver
# then run JVueServerApplication `main` function
# that's all
```

~~3. Jvue-front~~
3. jvue-front

```bash
cd ./jvue-front
yarn
yarn dev
```

### Test docker(for dev)
or somplely

```bash
docker compose -f docker-compose.yml up --build
```

### vercel

1. config

```
vercel pull
```

2. build

```
vercel build
```

3. start(not work)

```
vercel dev
./dev.sh
```

# Structure
Expand All @@ -108,4 +90,4 @@ Have fun and enjoy!

You can contribute simplely by create a pull request for me

For detailed explanation on how things work, please visit [author's blog](https://terwergreen.com).
For detailed explanation on how things work, please visit [author's blog](https://blog.terwergreen.com).
9 changes: 9 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# sudo n 14

cd jvue-server
./mvnw clean spring-boot:run -Dspring-boot.run.profiles=dev -DskipTests &

cd ../jvue-front
yarn dev
28 changes: 0 additions & 28 deletions docker-compose-mysql.yml

This file was deleted.

93 changes: 46 additions & 47 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,43 @@
# docker compose --log-level INFO up -- build
# docker compose --log-level INFO up -d --build

version: '3'
version: "3.8"

services:
# jvue-nginx:
# image: jvue/nginx:1.15.9
# container_name: jvue-nginx
# build:
# context: ./
# dockerfile: ./jvue-nginx/Dockerfile
# ports:
# - "80:80"
# volumes:
# - ./jvue-nginx/nginx.conf:/etc/nginx/conf.d/default.conf
# - ./data/nginx/log:/var/log/nginx
# restart: "no"
# jvue-mysql:
# image: jvue/mysql:5.7.24
# container_name: jvue-mysql
# build:
# context: ./
# dockerfile: ./jvue-mysql/Dockerfile
# ports:
# - "3306:3306"
# environment:
# # 最好使用此设定时区,其它静像也可以使用,也可以用"TZ=Asia/Shanghai"
# - "TZ=CST-8"
# - "MYSQL_ROOT_PASSWORD=123456"
# - "MYSQL_ROOT_HOST=%"
# - "MYSQL_DATABASE=bugucms4"
# - "MYSQL_USER=terwer"
# - "MYSQL_PASSWORD=123456"
# volumes:
# - ./data/mysql/db:/var/db
# - ./data/mysql/log:/var/log
# - ./jvue-mysql/my.cnf:/etc/my.cnf
# - ./jvue-mysql/init:/docker-entrypoint-initdb.d/
# restart: always
jvue-nginx:
image: jvue/nginx:1.15.9
container_name: jvue-nginx
build:
context: ./
dockerfile: ./jvue-nginx/Dockerfile
ports:
- "80:80"
volumes:
- ./jvue-nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./data/nginx/log:/var/log/nginx
restart: "no"
jvue-mysql:
image: jvue/mysql:5.7.24
container_name: jvue-mysql
build:
context: ./
dockerfile: ./jvue-mysql/Dockerfile
ports:
- "3308:3306"
environment:
# 最好使用此设定时区,其它静像也可以使用,也可以用"TZ=Asia/Shanghai"
- "TZ=CST-8"
- "MYSQL_ROOT_PASSWORD=123456"
- "MYSQL_ROOT_HOST=%"
- "MYSQL_DATABASE=bugucms4"
- "MYSQL_USER=terwer"
- "MYSQL_PASSWORD=123456"
volumes:
- ./data/mysql/db:/var/db
- ./data/mysql/log:/var/log
- ./jvue-mysql/my.cnf:/etc/my.cnf
- ./jvue-mysql/init:/docker-entrypoint-initdb.d/
restart: "no"
jvue-server:
image: jvue/server:4.0.1
container_name: jvue-server
Expand All @@ -47,20 +48,18 @@ services:
ports:
- "8002:8002"
working_dir: /app
command: mvn clean spring-boot:run -Dspring-boot.run.profiles=dev -DskipTests
command: mvn clean spring-boot:run -Dspring-boot.run.profiles=docker -DskipTests
volumes:
- ./jvue-server:/app
- ./data/maven/.m2:/root/.m2
- ./data/server/logs:/logs
restart: "no"
# jvue-front:
# container_name: jvue-front
# image: jvue/front:4.0.1
# build:
# context: .
# dockerfile: ./jvue-front/Dockerfile
# ports:
# - "3000:3000"
# environment:
# - npm_config_unsafe_perm=true
# restart: "no"
jvue-front:
container_name: jvue-front
image: jvue/front:4.0.1
build:
context: .
dockerfile: ./jvue-front/Dockerfile
ports:
- "3000:3000"
restart: "no"
13 changes: 13 additions & 0 deletions jvue-front/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
31 changes: 31 additions & 0 deletions jvue-front/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: "babel-eslint"
},
extends: [
"@nuxtjs",
"plugin:nuxt/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/vue"
],
plugins: ["prettier"],
// add your custom rules here
rules: {
"nuxt/no-cjs-in-config": "off",
"no-console": "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-unused-vars": [
2,
{
vars: "local",
args: "none"
}
]
}
};
91 changes: 91 additions & 0 deletions jvue-front/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE
.idea

# Service worker
sw.*
yarn.lock
.yarnclean
.nuxtrc
node_modules
node_modules_dev/
node_modules_prod/
node_modules/.yargit n-integrity
Loading