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

fix:fix docker build #163

Merged
merged 3 commits into from
Jun 19, 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
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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).
101 changes: 101 additions & 0 deletions docker-compose-mysql.yml
Original file line number Diff line number Diff line change
@@ -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 <new-password>;
# The database alert log can be viewed with
# $ docker logs <Oracle-DB>

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
91 changes: 91 additions & 0 deletions docker-compose-oracle.yml
Original file line number Diff line number Diff line change
@@ -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 <new-password>;
# The database alert log can be viewed with
# $ docker logs <Oracle-DB>

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
10 changes: 0 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down