Skip to content

Commit

Permalink
fix: 完善部署脚本 (#48)
Browse files Browse the repository at this point in the history
* feat: 新增部署脚本

* feat: 新增部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本

* fix: 完善部署脚本
  • Loading branch information
BanTanger committed Aug 3, 2023
1 parent dd3beed commit 9907298
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 469 deletions.
6 changes: 6 additions & 0 deletions cleanjar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# 删除 build 文件夹
echo "开始清理 build 文件夹 .."
rm -rf docker/build/
echo "清理完成"
22 changes: 22 additions & 0 deletions copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# 创建目标目录
mkdir -p docker/build/domain/jar
mkdir -p docker/build/message-store/jar
mkdir -p docker/build/tcp/jar

# 复制 Dockerfile 文件
echo "begin copy Dockerfile .."
cp im-domain/Dockerfile docker/build/domain/Dockerfile
cp im-message-store/Dockerfile docker/build/message-store/Dockerfile
cp im-tcp/Dockerfile docker/build/tcp/Dockerfile
echo "end copy Dockerfile "

echo ">>>>>>>>>>>>>>>>>"

# 复制 jar 文件
echo "begin copy jar .."
cp im-domain/target/im-domain-1.0-SNAPSHOT.jar docker/build/domain/jar/im-domain.jar
cp im-message-store/target/im-message-store-1.0-SNAPSHOT.jar docker/build/message-store/jar/im-message-store.jar
cp im-tcp/target/im-tcp-1.0-SNAPSHOT.jar docker/build/tcp/jar/im-tcp.jar
echo "end copy jar "
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ usage(){

# 启动基础环境(必须)
base(){
docker compose up -d mysql redis zookeeper rabbitmq
docker compose up -d im-mysql im-redis im-zookeeper im-rabbitmq
}

# 启动程序模块(必须)
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
container_name: im-mysql
image: mysql:8.0.11
build:
context: ./docker/mysql
context: ./build/mysql
restart: always
volumes:
- ./docker/mysql/conf:/etc/mysql/conf.d
Expand Down Expand Up @@ -75,7 +75,7 @@ services:
container_name: im-redis
image: redis:6.0.8
build:
context: ./docker/mysql
context: ./build/redis
restart: always
ports:
- "6379:6379"
Expand All @@ -89,10 +89,10 @@ services:
im-domain:
container_name: im_domain
build:
context: ./im-domain
context: ./docker/build/domain
restart: always
ports:
- "8000:8000"
- "18000:18000"
depends_on:
- im-mysql
- im-zookeeper
Expand All @@ -110,8 +110,10 @@ services:
im-message-store:
container_name: im-message-store
build:
context: ./im-message-store
context: ./docker/build/message-store
restart: always
ports:
- "18001:18001"
depends_on:
- im-mysql
- im-redis
Expand All @@ -120,17 +122,18 @@ services:
- im-mysql
- im-redis
- im-rabbitmq
ports:
- "8001:8001"
networks:
- im-network

# IM TCP 容器
im-tcp:
container_name: im-tcp
build:
context: ./im-tcp
context: ./docker/build/tcp
restart: always
ports:
- "19001:19001" # tcp 端口
- "19002:19002" # ws 端口
depends_on:
- im-redis
- im-rabbitmq
Expand All @@ -139,9 +142,6 @@ services:
- im-redis
- im-rabbitmq
- im-zookeeper
ports:
- "9001:9001" # tcp 端口
- "19001:19001" # ws 端口
networks:
- im-network

Expand Down
8 changes: 0 additions & 8 deletions docker/cleanjar.sh

This file was deleted.

13 changes: 0 additions & 13 deletions docker/copy.sh

This file was deleted.

Loading

0 comments on commit 9907298

Please sign in to comment.