diff --git a/README.md b/README.md index 6a2748a..c5e0f6a 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docker-compose-ali-no-mysql.yml b/docker-compose-ali-no-mysql.yml index 6d54ba9..c04cf78 100644 --- a/docker-compose-ali-no-mysql.yml +++ b/docker-compose-ali-no-mysql.yml @@ -1,4 +1,4 @@ -version: '3.0' +version: '2.1' services: moneywhere-api-user: diff --git a/docker-compose-ali.yml b/docker-compose-ali.yml index afe2627..1284145 100644 --- a/docker-compose-ali.yml +++ b/docker-compose-ali.yml @@ -1,4 +1,4 @@ -version: '3' +version: '2.1' services: mysql: diff --git a/docker-compose-hub-no-mysql.yml b/docker-compose-hub-no-mysql.yml index 389a268..879b50e 100644 --- a/docker-compose-hub-no-mysql.yml +++ b/docker-compose-hub-no-mysql.yml @@ -1,4 +1,4 @@ -version: '3.0' +version: '2.1' services: moneywhere-api-user: diff --git a/docker-compose-hub.yml b/docker-compose-hub.yml index d674a29..eceb605 100644 --- a/docker-compose-hub.yml +++ b/docker-compose-hub.yml @@ -1,4 +1,4 @@ -version: '3' +version: '2.1' services: mysql: diff --git a/docker-compose-no-mysql.yml b/docker-compose-no-mysql.yml index 389a268..c04cf78 100644 --- a/docker-compose-no-mysql.yml +++ b/docker-compose-no-mysql.yml @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml index 7bdc420..1284145 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: