This commit is contained in:
markliu2013 2023-09-14 00:33:09 +08:00
parent faa89b669d
commit 118c531f59
7 changed files with 20 additions and 23 deletions

View File

@ -29,10 +29,10 @@ docker-compose -f docker-compose-no-mysql.yml up -d
```
如果docker hub镜像无法访问,请使用阿里云镜像:
默认使用阿里云镜像,适合运行在中国大陆的服务器,如果服务器在境外,推荐使用docker hub镜像
```sh
docker-compose -f docker-compose-ali.yml up -d
docker-compose -f docker-compose-hub.yml up -d
```
版本升级,使用最新镜像。
@ -53,3 +53,6 @@ phpMyAdmin登录的信息请对照api.env配置文件填写。请定期使用php
## QA
1. 很多人安装遇到数据库的问题有可能是之前安装过有数据文件且自己修改过root密码。 使用 docker volume ls 命令查看有没有moneywhere_mysql_data文件如果有可以自己修改为另外的数据文件或者删除moneywhere_mysql_data
## 参考资料
[安装docker](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-centos-7)

View File

@ -1,4 +1,4 @@
version: '3.0'
version: '2.1'
services:
moneywhere-api-user:

View File

@ -1,4 +1,4 @@
version: '3'
version: '2.1'
services:
mysql:

View File

@ -1,4 +1,4 @@
version: '3.0'
version: '2.1'
services:
moneywhere-api-user:

View File

@ -1,4 +1,4 @@
version: '3'
version: '2.1'
services:
mysql:

View File

@ -1,8 +1,8 @@
version: '3.0'
version: '2.1'
services:
moneywhere-api-user:
image: markliu2018/moneywhere-api-user:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: api-no-mysql.env
@ -10,7 +10,7 @@ services:
moneywhere-fe-user:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -19,7 +19,7 @@ services:
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:

View File

@ -1,28 +1,22 @@
version: '3'
version: '2.1'
services:
mysql:
image: mysql:5.7
build: ./mysql/
command: --init-file /data/1.sql
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: phpmyadmin/phpmyadmin
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/phpmyadmin:latest
links:
- mysql
environment:
@ -37,13 +31,13 @@ services:
depends_on:
mysql:
condition: service_healthy
image: markliu2018/moneywhere-api-user:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
env_file: api.env
moneywhere-fe-user:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports:
@ -52,7 +46,7 @@ services:
moneywhere-fe-user-mobile:
links:
- moneywhere-api-user
image: markliu2018/moneywhere-fe-user-mobile:latest
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-fe-user-mobile:latest
environment:
USER_API_HOST: http://moneywhere-api-user:9092
ports: