This commit is contained in:
markliu2013 2023-08-10 21:08:40 +08:00
parent 747cd7cd8e
commit d310b695c4
7 changed files with 125 additions and 16 deletions

View File

@ -6,7 +6,9 @@
请确保本机已安装docker compose。如遇到任何问题欢迎加入 QQ群: 639653091 讨论。
启动前请修改docker-compose.yml数据的默认root密码MYSQL_ROOT_PASSWORD修改为自己的密码。
启动前请修改docker-compose.yml数据的默认root密码MYSQL_ROOT_PASSWORD修改为自己的密码同时修改api.env文件。
为防止恶意注册请修改api.env中的邀请码。如遇端口冲突问题请修改docker-compose.yml文件修改对应的端口。
```sh
$ git clone --depth 1 https://github.com/getmoneynote/docker-compose-moneywhere.git
@ -28,11 +30,7 @@
如需备份数据,请访问 [http://127.0.0.1:8085](http://127.0.0.1:8085) 打开phpMyAdmin操作数据库是MySQL5.7。
phpMyAdmin登录的信息请对照api.env配置文件填写。
请定期使用打开phpMyAdmin导出sql文件备份你的记账数据
邀请码可以在api.env文件修改 invite_code 变量如遇端口冲突问题请修改docker-compose.yml文件修改对应的端口。
phpMyAdmin登录的信息请对照api.env配置文件填写。请定期使用phpMyAdmin导出sql文件备份你的记账数据
## QA
1. 很多人安装遇到数据库的问题有可能是之前安装过有数据文件且自己修改过root密码。 使用 docker volume ls 命令查看有没有moneywhere_mysql_data文件如果有可以自己修改为另外的数据文件或者删除moneywhere_mysql_data

View File

@ -0,0 +1,24 @@
version: '3.0'
services:
moneywhere-api-user:
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9097:80"
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9098:80"

56
docker-compose-ali.yml Normal file
View File

@ -0,0 +1,56 @@
version: '3'
services:
mysql:
build: ./mysql/
command: --init-file /data/1.sql
restart: always
environment:
MYSQL_ROOT_PASSWORD: NWPkVrO2
MYSQL_DATABASE: moneywhere
volumes:
- moneywhere_mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -pNWPkVrO2 | grep 'mysqld is alive' || exit 1"]
timeout: 20s
retries: 10
phpmyadmin:
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/phpmyadmin:latest
links:
- mysql
environment:
PMA_HOST: mysql
PMA_PORT: 3306
PMA_ARBITRARY: 1
restart: always
ports:
- "8085:80"
moneywhere-api-user:
depends_on:
mysql:
condition: service_healthy
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9097:80"
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9098:80"
volumes:
moneywhere_mysql_data:

View File

@ -0,0 +1,24 @@
version: '3.0'
services:
moneywhere-api-user:
image: markliu2018/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9097:80"
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
- "9098:80"

View File

@ -2,13 +2,13 @@ version: '3.0'
services:
moneywhere-api-user:
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
image: markliu2018/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
image: markliu2018/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -17,7 +17,7 @@ services:
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
image: markliu2018/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -2,21 +2,27 @@ version: '3'
services:
mysql:
build: ./mysql/
command: --init-file /data/1.sql
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: NWPkVrO2
MYSQL_DATABASE: moneywhere
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci',
'--max_connections=10000'
]
volumes:
- moneywhere_mysql_data:/var/lib/mysql
healthcheck:
# test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -pNWPkVrO2 | grep 'mysqld is alive' || exit 1"]
# test: ["CMD-SHELL", "mysqladmin ping | grep 'Access denied' || exit 1"]
timeout: 20s
retries: 10
phpmyadmin:
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/phpmyadmin:latest
image: phpmyadmin/phpmyadmin
links:
- mysql
environment:
@ -31,13 +37,13 @@ services:
depends_on:
mysql:
condition: service_healthy
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
image: markliu2018/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
image: markliu2018/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -46,7 +52,7 @@ services:
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
image: markliu2018/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -1 +1,2 @@
docker-compose -f docker-compose-hub.yml up -d
docker-compose -f docker-compose-hub.yml up -d
docker-compose -f docker-compose-no-mysql.yml up -d