From 948b97cbd059f31af37908e4435a57ebe15e2b4c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 20 Sep 2023 23:11:09 +0800 Subject: [PATCH] save --- docker-compose-ali.yml | 22 +++++------- docker-compose-hub.yml | 7 +--- docker-compose.yml | 22 +++++------- docker-compose_health_check_bak.yml | 56 +++++++++++++++++++++++++++++ mysql/my.cnf | 1 - 5 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 docker-compose_health_check_bak.yml diff --git a/docker-compose-ali.yml b/docker-compose-ali.yml index 1284145..6fbd097 100644 --- a/docker-compose-ali.yml +++ b/docker-compose-ali.yml @@ -2,35 +2,31 @@ version: '2.1' services: mysql: - build: ./mysql/ - command: --init-file /data/1.sql + image: registry.cn-hangzhou.aliyuncs.com/moneywhere/mysql:5.7 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 + command: [ + '--character-set-server=utf8mb4', + '--collation-server=utf8mb4_general_ci', + '--max_connections=10000' + '--default-authentication-plugin=mysql_native_password' + ] 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 + links: + - mysql image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest env_file: api.env diff --git a/docker-compose-hub.yml b/docker-compose-hub.yml index eceb605..dbe1b49 100644 --- a/docker-compose-hub.yml +++ b/docker-compose-hub.yml @@ -11,15 +11,10 @@ services: '--character-set-server=utf8mb4', '--collation-server=utf8mb4_general_ci', '--max_connections=10000' + '--default-authentication-plugin=mysql_native_password' ] 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 diff --git a/docker-compose.yml b/docker-compose.yml index 1284145..6fbd097 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,35 +2,31 @@ version: '2.1' services: mysql: - build: ./mysql/ - command: --init-file /data/1.sql + image: registry.cn-hangzhou.aliyuncs.com/moneywhere/mysql:5.7 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 + command: [ + '--character-set-server=utf8mb4', + '--collation-server=utf8mb4_general_ci', + '--max_connections=10000' + '--default-authentication-plugin=mysql_native_password' + ] 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 + links: + - mysql image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest env_file: api.env diff --git a/docker-compose_health_check_bak.yml b/docker-compose_health_check_bak.yml new file mode 100644 index 0000000..1284145 --- /dev/null +++ b/docker-compose_health_check_bak.yml @@ -0,0 +1,56 @@ +version: '2.1' + +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: \ No newline at end of file diff --git a/mysql/my.cnf b/mysql/my.cnf index 3549bba..5591e7d 100644 --- a/mysql/my.cnf +++ b/mysql/my.cnf @@ -7,7 +7,6 @@ [mysqld] character-set-server=utf8mb4 -character-set-server=utf8 #default-time-zone='+8:00' #innodb_rollback_on_timeout='ON' #max_connections=500