Skip to content

Commit fd60e9a

Browse files
authored
Merge pull request #371 from Jzow/master
[EAIRP-365] Document on Improving Docker Deployment Methods
2 parents 263ec90 + bd82200 commit fd60e9a

File tree

4 files changed

+155
-6
lines changed

4 files changed

+155
-6
lines changed

README.md

+77
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,85 @@ It's completely free, if this project is helpful to you, please click on Star. T
4141
- test password: 123456
4242

4343
## Quick Start
44+
4445
We provide a more comprehensive Docker deployment method, which can be found in [docker folder](https://github.com/eairps/eairp/blob/master/docker/README.md)
4546

47+
### Prerequisites
48+
- Docker Engine 20.10+
49+
- Docker Compose v2.17+
50+
51+
### 1. Docker Compose (Recommended)
52+
53+
**Applicable scenarios**: There is no MySQL/Redis environment locally, and a complete service stack needs to be started quickly.
54+
55+
```bash
56+
# Clone deployment repository
57+
git clone https://github.com/eairps/eairp.git
58+
59+
cd eairp
60+
61+
# Start services
62+
docker compose up -d
63+
```
64+
65+
### 2. Docker standalone container
66+
67+
**Applicable scenarios**: MySQL/Redis service already exists, and custom database configuration is required.
68+
69+
**Step 1**: Create a Private Network
70+
71+
```console
72+
docker network create eairp-net
73+
```
74+
75+
**Step 2**: Start the MySQL container
76+
77+
```console
78+
docker run -d --name mysql-eairp \
79+
--network eairp-net \
80+
-p 3306:3306 \
81+
-v /path/to/mysql:/var/lib/mysql \
82+
-e MYSQL_ROOT_PASSWORD=123456 \
83+
-e MYSQL_USER=eairp \
84+
-e MYSQL_PASSWORD=123456 \
85+
mysql:8.3 \
86+
--character-set-server=utf8mb4 \
87+
--collation-server=utf8mb4_bin
88+
```
89+
90+
**Step 3**: Start the Redis container
91+
92+
```console
93+
docker run -d --name redis-eairp \
94+
--network eairp-net \
95+
-p 6379:6379 \
96+
-v /path/to/redis/data:/data \
97+
redis:7.0 \
98+
redis-server --requirepass 123456
99+
```
100+
101+
**Step 4**: Start the Eairp container
102+
103+
Configuration parameters:
104+
| Environment variables | Explanation | Example Value |
105+
| ---- | ---- | ---- |
106+
| SPRING_DATASOURCE_URL | MySQL connection address | jdbc:mysql://mysql-eairp:3306/eairp |
107+
| SPRING_REDIS_HOST | Redis host address | redis-eairp |
108+
| API_BASE_URL | Front-end API basic path | http://your-domain.com/erp-api |
109+
110+
```console
111+
docker run -d --name eairp \
112+
--network eairp-net \
113+
-p 3000:80 \
114+
-p 8088:8088 \
115+
-e SPRING_DATASOURCE_URL="jdbc:mysql://mysql-eairp:3306/eairp" \
116+
-e SPRING_DATASOURCE_USERNAME=eairp \
117+
-e SPRING_DATASOURCE_PASSWORD=123456 \
118+
-e SPRING_REDIS_HOST=redis-eairp \
119+
-e SPRING_REDIS_PASSWORD=123456 \
120+
wansenai/eairp:latest
121+
```
122+
46123
## License
47124

48125
Licensed under either of

README_ZH.md

+76
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,82 @@
4343
## 快速开始
4444
我们提供了一种更全面的Docker部署方法,可以在[Docker](https://github.com/eairps/eairp/blob/master/docker/README_ZH.md)文件夹中找到
4545

46+
### 先决条件
47+
- Docker Engine 20.10+
48+
- Docker Compose v2.17+
49+
50+
### 1. Docker Compose(推荐)
51+
52+
**适用场景**: 本地没有MySQL/Redis环境,需要快速启动完整的服务栈。
53+
54+
```bash
55+
# Clone deployment repository
56+
git clone https://github.com/eairps/eairp.git
57+
58+
cd eairp
59+
60+
# Start services
61+
docker compose up -d
62+
```
63+
64+
### 2. Docker 独立容器
65+
66+
**适用场景**: MySQL/Redis服务已经存在,需要自定义数据库配置。
67+
68+
**步骤 1**: 创建专用网络
69+
70+
```console
71+
docker network create eairp-net
72+
```
73+
74+
**步骤 2**: 启动 MySQL 容器
75+
76+
```console
77+
docker run -d --name mysql-eairp \
78+
--network eairp-net \
79+
-p 3306:3306 \
80+
-v /path/to/mysql:/var/lib/mysql \
81+
-e MYSQL_ROOT_PASSWORD=123456 \
82+
-e MYSQL_USER=eairp \
83+
-e MYSQL_PASSWORD=123456 \
84+
mysql:8.3 \
85+
--character-set-server=utf8mb4 \
86+
--collation-server=utf8mb4_bin
87+
```
88+
89+
**步骤 3**: 启动 Redis 容器
90+
91+
```console
92+
docker run -d --name redis-eairp \
93+
--network eairp-net \
94+
-p 6379:6379 \
95+
-v /path/to/redis/data:/data \
96+
redis:7.0 \
97+
redis-server --requirepass 123456
98+
```
99+
100+
**步骤 4**: 启动 Eairp 容器
101+
102+
配置参数:
103+
| 环境变量 | 说明 | 示例值 |
104+
| ---- | ---- | ---- |
105+
| SPRING_DATASOURCE_URL | MySQL connection address | jdbc:mysql://mysql-eairp:3306/eairp |
106+
| SPRING_REDIS_HOST | Redis host address | redis-eairp |
107+
| API_BASE_URL | Front-end API basic path | http://your-domain.com/erp-api |
108+
109+
```console
110+
docker run -d --name eairp \
111+
--network eairp-net \
112+
-p 3000:80 \
113+
-p 8088:8088 \
114+
-e SPRING_DATASOURCE_URL="jdbc:mysql://mysql-eairp:3306/eairp" \
115+
-e SPRING_DATASOURCE_USERNAME=eairp \
116+
-e SPRING_DATASOURCE_PASSWORD=123456 \
117+
-e SPRING_REDIS_HOST=redis-eairp \
118+
-e SPRING_REDIS_PASSWORD=123456 \
119+
wansenai/eairp:latest
120+
```
121+
46122
## License
47123

48124
根据以下任一许可证之一,对本项目中的代码和文档进行许可:

docker/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,14 @@ If you want to deploy on your server, please modify the value of the `API_BASE_U
164164

165165
Another solution is to use the Docker Compose files we provide.
166166

167-
First you need to download the [eairp source code](https://github.com/wansenai/eairp/releases) to your local machine, then you must download 5 files from [eairp-docker](https://github.com/wansenai/eairp-docker) repository, they are:
167+
First you need to download the [eairp source code](https://github.com/wansenai/eairp/releases) to your local machine.
168168

169169
- `.env`
170170
- `Dockerfile`
171171
- `docker-compose.yaml`
172172
- `start.sh`
173173
- `mysql-scripts/eairp.sql`
174174

175-
Then copy these four files and the `mysql-scripts` folder to the Eairp source code directory structure, Note that `mysql-scripts` is a folder. You need to copy the folder in its entirety instead of the sql file inside.
176-
177175
The complete directory structure is as follows:
178176

179177
```markdown

docker/README_ZH.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,14 @@ docker run --net=eairp-nw -d --name eairp -p 8088:8088 -p 3000:80 -v /usr/local/
160160

161161
另一种解决方案是使用我们提供的Docker Compose文件。
162162

163-
首先,您需要下载[eairp源代码](https://github.com/eairps/eairp/releases)到您的本地计算机,然后您必须从[docker](https://github.com/eairps/eairp/tree/master/docker)文件夹下载5个文件,它们是:
163+
首先,您需要下载[eairp源代码](https://github.com/eairps/eairp/releases)到您的本地计算机,它们是:
164164

165165
- `.env`
166166
- `Dockerfile`
167167
- `docker-compose.yaml`
168168
- `start.sh`
169169
- `mysql-scripts/eairp.sql`
170170

171-
然后将这四个文件和 `mysql-scripts` 文件夹复制到Eairp源代码目录结构中,注意 `mysql-scscripts` 是一个文件夹。您需要复制整个文件夹,而不仅仅是其中的sql文件。
172-
173171
完整的目录结构如下:
174172

175173
```markdown

0 commit comments

Comments
 (0)