This commit is contained in:
markliu2013 2024-01-24 23:18:19 +08:00
parent aa8f2204cd
commit 4eea78f8ed
8 changed files with 97 additions and 20 deletions

View File

@ -4,42 +4,79 @@
部署前请确保已安装docker compose。如遇到任何问题欢迎加入 QQ群: 639653091 讨论。
部署步骤:
### 部署步骤:
1. 请下载本项目源代码使用git命令或直接下载源代码。
```sh
git clone https://github.com/getmoneynote/docker-compose-moneywhere.git && cd docker-compose-moneywhere
```
2. 为保证数据安全问题请修改数据库默认密码一共2个地方需要修改。
1. docker-compose.yml文件 MYSQL_ROOT_PASSWORD变量
2. api.env DB_PASSWORD变量修改
3. 为防止恶意注册请修改默认邀请码。api.env文件invite_code变量修改
2. 为保证数据安全问题请修改数据库默认密码。api.env -> DB_PASSWORD
3. 为防止恶意注册请修改默认邀请码。api.env -> invite_code
4. 执行命令
```sh
docker compose up -d
docker compose --env-file api.env up -d
```
如果已有mysql服务想使用已存在的mysql服务请修改项目的mysql相关配置,执行命令
如果已有mysql服务想使用已存在的mysql服务请修改api-no-mysql.env文件为对应数据库信息,执行命令
```sh
docker compose -f docker-compose-no-mysql.yml up -d
docker compose --env-file api-no-mysql.env -f docker-compose-no-mysql.yml up -d
```
默认使用Docker Hub官方网站镜像中国大陆可能出现无法拉去镜像可尝试使用阿里云镜像。项目运行后本身不依赖任何外部第三方服务。
```sh
docker compose -f docker-compose-ali.yml up -d
docker compose --env-file api.env -f docker-compose-ali.yml up -d
```
版本升级,使用最新镜像。
```sh
docker compose pull && docker compose up -d
docker compose pull && docker compose --env-file api.env up -d
```
#### docker命令说明
docker hub with mysql 启动
```sh
docker compose -f docker-compose-no-mysql.yml pull && docker compose -f docker-compose-no-mysql.yml up -d
docker compose --env-file api.env -f docker-compose-hub.yml up -d
```
docker hub no mysql 启动
```sh
docker-compose --env-file api-no-mysql -f docker-compose-hub-no-mysql.yml up -d
```
阿里云 with mysql 启动
```sh
docker compose --env-file api.env -f docker-compose-ali.yml up -d
```
阿里云 no mysql 启动
```sh
docker-compose --env-file api-no-mysql.env -f docker-compose-ali-no-mysql.yml up -d
```
docker hub with mysql 升级
```sh
docker compose -f docker-compose-hub.yml pull && docker compose --env-file api.env -f docker-compose-hub.yml up -d
```
docker hub no mysql 升级
```sh
docker compose -f docker-compose-hub-no-mysql.yml pull && docker-compose --env-file api-no-mysql -f docker-compose-hub-no-mysql.yml up -d
```
阿里云 with mysql 升级
```sh
docker compose -f docker-compose-ali.yml pull && docker compose --env-file api.env -f docker-compose-ali.yml up -d
```
阿里云 no mysql 升级
```sh
docker compose -f docker-compose-ali-no-mysql.yml pull && docker-compose --env-file api-no-mysql.env -f docker-compose-ali-no-mysql.yml up -d
```
成功运行后,访问 [http://127.0.0.1:43743](http://127.0.0.1:43743) 可以打开网页版记账程序使用前请注册一个账户默认的邀请码是1111116个1, 为防止被恶意注册,请修改默认邀请码。

View File

@ -4,6 +4,7 @@ services:
moneywhere-api-user:
container_name: moneywhere_api
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: api-no-mysql.env
@ -15,6 +16,7 @@ services:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -25,6 +27,7 @@ services:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -4,10 +4,12 @@ services:
mysql:
container_name: moneywhere_mysql
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/mysql:5.7
env_file:
- api.env
restart: always
environment:
MYSQL_ROOT_PASSWORD: 111111
MYSQL_DATABASE: moneywhere
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci',
@ -35,6 +37,7 @@ services:
links:
- mysql
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
restart: always
env_file: api.env
ports:
- "43742:9092"
@ -44,6 +47,7 @@ services:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -54,6 +58,7 @@ services:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -4,6 +4,7 @@ services:
moneywhere-api-user:
container_name: moneywhere_api
image: markliu2018/moneywhere-api-user:latest
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: api-no-mysql.env
@ -15,6 +16,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -25,6 +27,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -4,10 +4,11 @@ services:
mysql:
container_name: moneywhere_mysql
image: mysql:5.7
env_file: api.env
restart: always
environment:
MYSQL_ROOT_PASSWORD: 111111
MYSQL_DATABASE: moneywhere
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci',
@ -22,11 +23,11 @@ services:
phpmyadmin:
container_name: moneywhere_phpmyadmin
image: phpmyadmin/phpmyadmin
restart: always
links:
- mysql
environment:
PMA_ARBITRARY: 1
restart: always
ports:
- "43741:80"
@ -35,6 +36,7 @@ services:
links:
- mysql
image: markliu2018/moneywhere-api-user:latest
restart: always
env_file: api.env
ports:
- "43742:9092"
@ -44,6 +46,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -54,6 +57,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -4,6 +4,7 @@ services:
moneywhere-api-user:
container_name: moneywhere_api
image: markliu2018/moneywhere-api-user:latest
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: api-no-mysql.env
@ -15,6 +16,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -25,6 +27,7 @@ services:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
restart: always
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -4,10 +4,11 @@ services:
mysql:
container_name: moneywhere_mysql
image: mysql:5.7
env_file: api.env
restart: always
environment:
MYSQL_ROOT_PASSWORD: 111111
MYSQL_DATABASE: moneywhere
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci',

View File

@ -1,2 +1,23 @@
docker-compose -f docker-compose-hub.yml up -d
docker-compose -f docker-compose-no-mysql.yml up -d
docker hub with mysql 启动
docker compose --env-file api.env -f docker-compose-hub.yml up -d
docker hub no mysql 启动
docker-compose --env-file api-no-mysql -f docker-compose-hub-no-mysql.yml up -d
阿里云 with mysql 启动
docker compose --env-file api.env -f docker-compose-ali.yml up -d
阿里云 no mysql 启动
docker-compose --env-file api-no-mysql.env -f docker-compose-ali-no-mysql.yml up -d
docker hub with mysql 升级
docker compose -f docker-compose-hub.yml pull && docker compose --env-file api.env -f docker-compose-hub.yml up -d
docker hub no mysql 升级
docker compose -f docker-compose-hub-no-mysql.yml pull && docker-compose --env-file api-no-mysql -f docker-compose-hub-no-mysql.yml up -d
阿里云 with mysql 升级
docker compose -f docker-compose-ali.yml pull && docker compose --env-file api.env -f docker-compose-ali.yml up -d
阿里云 no mysql 升级
docker compose -f docker-compose-ali-no-mysql.yml pull && docker-compose --env-file api-no-mysql.env -f docker-compose-ali-no-mysql.yml up -d