diff --git a/README.md b/README.md index ba1b975..5eaf63a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Next light-weight,responsive project With Docker,Vue,Vue CLI 3,webpack,Java and Spring Boot -# Important Changes in Jvue 4 +# Important Changes in JVue 4 Use [Docker](https://docs.docker.com/develop/dev-best-practices/) for deploy @@ -40,20 +40,23 @@ yum install docker 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/ + +## run jvue ```bash -docker-compose up +docker compose up --build ``` +or + ```bash -docker-compose up -d +docker compose up -d --build ``` -See https://docs.docker.com/compose/reference/up/ - # Check ```bash -docker-compose ps +docker compose ps ``` # Structure @@ -65,4 +68,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](http://www.terwergreen.com). +For detailed explanation on how things work, please visit [author's blog](https://terwergreen.com). \ No newline at end of file diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml new file mode 100644 index 0000000..9c19f48 --- /dev/null +++ b/docker-compose-mysql.yml @@ -0,0 +1,101 @@ +# 构建docker-compose项目 +# docker-compose --log-level INFO build +# docker-compose --log-level INFO build jvue-front + +# 重启并清理以及重建容器 +# docker-compose --log-level INFO up --force-recreate --remove-orphans +# docker-compose --log-level INFO up --force-recreate jvue-front + +# 重启并重建镜像 +# docker-compose --log-level INFO up --build --force-recreate --remove-orphans +# docker-compose --log-level INFO up --build --force-recreate jvue-front + +# 启动守护线程 +# docker-compose --log-level INFO up -d + +# 重启并重建镜像启动守护线程 +# docker-compose --log-level INFO up -d --build --force-recreate jvue-front + +# oracle doc +# DB_SID +# This parameter changes the ORACLE_SID of the database. The default value is set to ORCLCDB. +# To connect from outside the container using SQL*Plus, +# $ sqlplus sys/Oradoc_db1@ORCLCDB as sysdba +# Changing default password for SYS user +# alter user sys identified by ; +# The database alert log can be viewed with +# $ docker logs + +version: '3' +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: always + 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=testbugucms" + - "MYSQL_USER=test" + - "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-server: + image: jvue/server:4.0.0 + container_name: jvue-server + build: + context: ./ + dockerfile: ./jvue-server/Dockerfile + ports: + - "8081:8081" + working_dir: /app + 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: always + jvue-front: + 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 + restart: always + jvue-admin: + 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 + restart: always \ No newline at end of file diff --git a/docker-compose-oracle.yml b/docker-compose-oracle.yml new file mode 100644 index 0000000..bf8191f --- /dev/null +++ b/docker-compose-oracle.yml @@ -0,0 +1,91 @@ +# 构建docker-compose项目 +# docker-compose --log-level INFO build +# docker-compose --log-level INFO build jvue-front + +# 重启并清理以及重建容器 +# docker-compose --log-level INFO up --force-recreate --remove-orphans +# docker-compose --log-level INFO up --force-recreate jvue-front + +# 重启并重建镜像 +# docker-compose --log-level INFO up --build --force-recreate --remove-orphans +# docker-compose --log-level INFO up --build --force-recreate jvue-front + +# 启动守护线程 +# docker-compose --log-level INFO up -d + +# 重启并重建镜像启动守护线程 +# docker-compose --log-level INFO up -d --build --force-recreate jvue-front + +# oracle doc +# DB_SID +# This parameter changes the ORACLE_SID of the database. The default value is set to ORCLCDB. +# To connect from outside the container using SQL*Plus, +# $ sqlplus sys/Oradoc_db1@ORCLCDB as sysdba +# Changing default password for SYS user +# alter user sys identified by ; +# The database alert log can be viewed with +# $ docker logs + +version: '3' +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: always + jvue-oracle: + image: jvue/oracle:oracle-xe-11g + container_name: jvue-oracle + build: + context: ./ + dockerfile: ./jvue-oracle/Dockerfile + ports: + - "1521:1521" + - "5500:5500" + volumes: + - ./data/oracle:/u01/app/oracle + restart: always + jvue-server: + image: jvue/server:4.0.0 + container_name: jvue-server + build: + context: ./ + dockerfile: ./jvue-server/Dockerfile + ports: + - "8081:8081" + working_dir: /app + 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: always + jvue-front: + 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 + restart: always + jvue-admin: + 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 + restart: always \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b1301f7..be24556 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,16 +59,6 @@ services: volumes: - ./jvue-mysql/init:/docker-entrypoint-initdb.d/ restart: always -# jvue-oracle: -# image: jvue/oracle:oracle-xe-11g -# container_name: jvue-oracle -# build: -# context: ./ -# dockerfile: ./jvue-oracle/Dockerfile -# ports: -# - "1521:1521" -# - "5500:5500" -# restart: always jvue-server: image: jvue/server:4.0.0 container_name: jvue-server