This commit is contained in:
markliu2013 2023-08-09 20:43:18 +08:00
parent 466a180e55
commit 747cd7cd8e
5 changed files with 17 additions and 53 deletions

View File

@ -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:

View File

@ -2,14 +2,24 @@ version: '3'
services: services:
mysql: mysql:
build: ./mysql/ image: mysql:5.7
command: --init-file /data/1.sql
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: NWPkVrO2 MYSQL_ROOT_PASSWORD: NWPkVrO2
MYSQL_DATABASE: moneywhere MYSQL_DATABASE: moneywhere
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci',
'--max_connections=10000'
]
volumes: volumes:
- moneywhere_mysql_data:/var/lib/mysql - 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: phpmyadmin:
image: phpmyadmin/phpmyadmin image: phpmyadmin/phpmyadmin
@ -25,12 +35,10 @@ services:
moneywhere-api-user: moneywhere-api-user:
depends_on: depends_on:
- mysql mysql:
condition: service_healthy
image: markliu2018/moneywhere-api-user:latest image: markliu2018/moneywhere-api-user:latest
env_file: api.env env_file: api.env
environment:
- TZ=Asia/Singapore
- DEBIAN_FRONTEND=noninteractive
moneywhere-fe-user: moneywhere-fe-user:
links: links:

View File

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

View File

@ -11,7 +11,7 @@ services:
volumes: volumes:
- moneywhere_mysql_data:/var/lib/mysql - moneywhere_mysql_data:/var/lib/mysql
healthcheck: healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -pNWPkVrO2 | grep 'mysqld is alive' || exit 1"]
timeout: 20s timeout: 20s
retries: 10 retries: 10
@ -33,9 +33,6 @@ services:
condition: service_healthy condition: service_healthy
image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest image: registry.cn-hangzhou.aliyuncs.com/moneywhere/moneywhere-api-user:latest
env_file: api.env env_file: api.env
environment:
- TZ=Asia/Singapore
- DEBIAN_FRONTEND=noninteractive
moneywhere-fe-user: moneywhere-fe-user:
links: links:

1
notes.txt Normal file
View File

@ -0,0 +1 @@
docker-compose -f docker-compose-hub.yml up -d