diff --git a/docker-compose-bak.yml b/docker-compose-bak.yml deleted file mode 100644 index cddf1b0..0000000 --- a/docker-compose-bak.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: '3.6' - -services: - mysql: - build: ./mysql/ - command: --init-file /data/1.sql - restart: always - environment: - - MYSQL_ROOT_PASSWORD=123456 - volumes: - - moneywhere_mysql_data:/var/lib/mysql - - phpmyadmin: - image: phpmyadmin/phpmyadmin - links: - - mysql - ports: - - "8085:80" - environment: - PMA_ARBITRARY: 1 - PMA_HOST: mysql - PMA_USER: root - PMA_PASSWORD: 123456 - - moneywhere-api-user: - depends_on: - - mysql - image: markliu2018/moneywhere-api-user:latest - env_file: api.env - - moneywhere-fe-user: - depends_on: - - moneywhere-api-user - image: markliu2018/moneywhere-fe-user:latest - environment: - USER_API_HOST: http://moneywhere-api-user:9092 - API_HOST: https://api.moneywhere.com/api/v1/user-api - ports: - - "9097:80" - -volumes: - moneywhere_mysql_data: \ No newline at end of file diff --git a/docker-compose-hub.yml b/docker-compose-hub.yml index 9f95a9f..d674a29 100644 --- a/docker-compose-hub.yml +++ b/docker-compose-hub.yml @@ -2,14 +2,24 @@ 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: phpmyadmin/phpmyadmin @@ -25,12 +35,10 @@ services: moneywhere-api-user: depends_on: - - mysql + mysql: + condition: service_healthy image: markliu2018/moneywhere-api-user:latest env_file: api.env - environment: - - TZ=Asia/Singapore - - DEBIAN_FRONTEND=noninteractive moneywhere-fe-user: links: diff --git a/docker-compose-no-mysql.yml b/docker-compose-no-mysql.yml index 2a61878..41c2d66 100644 --- a/docker-compose-no-mysql.yml +++ b/docker-compose-no-mysql.yml @@ -1,4 +1,4 @@ -version: '3.6' +version: '3.0' services: moneywhere-api-user: diff --git a/docker-compose.yml b/docker-compose.yml index 86ab6d2..afe2627 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: 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"] timeout: 20s retries: 10 @@ -33,9 +33,6 @@ services: condition: service_healthy image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest env_file: api.env - environment: - - TZ=Asia/Singapore - - DEBIAN_FRONTEND=noninteractive moneywhere-fe-user: links: diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..3400a10 --- /dev/null +++ b/notes.txt @@ -0,0 +1 @@ +docker-compose -f docker-compose-hub.yml up -d \ No newline at end of file