@@ -9,7 +9,7 @@ services:
99 - USE_REDIS=1
1010 - REDIS_HOST=redis
1111 - REDIS_PORT=6379
12- # Database configuration (uncomment mysql service below if needed)
12+ # ========== MySQL Configuration (uncomment to enable) ==========
1313 # - DB_HOST=mysql
1414 # - DB_PORT=3306
1515 # - DB_USER=root
@@ -21,6 +21,7 @@ services:
2121 depends_on :
2222 redis :
2323 condition : service_healthy
24+ # ========== Uncomment below to wait for MySQL ==========
2425 # mysql:
2526 # condition: service_healthy
2627 restart : unless-stopped
@@ -48,25 +49,29 @@ services:
4849 volumes :
4950 - redis_data:/data
5051 command : redis-server --appendonly yes
51-
52- # Uncomment below to enable MySQL
52+
53+ # ========== MySQL Service (uncomment entire block to enable) ==========
5354 # mysql:
5455 # image: mysql:8.0
55- # environment:
56- # MYSQL_ROOT_PASSWORD: ms_oauth2api_root
57- # MYSQL_DATABASE: ms_oauth2api
5856 # ports:
5957 # - "13306:3306"
60- # volumes:
61- # - mysql_data:/var/lib/mysql
58+ # environment:
59+ # - MYSQL_ROOT_PASSWORD=ms_oauth2api_root
60+ # - MYSQL_DATABASE=ms_oauth2api
61+ # - MYSQL_CHARACTER_SET_SERVER=utf8mb4
62+ # - MYSQL_COLLATION_SERVER=utf8mb4_unicode_ci
6263 # restart: unless-stopped
6364 # networks:
6465 # - app-network
6566 # healthcheck:
66- # test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
67+ # test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pms_oauth2api_root" ]
6768 # interval: 10s
6869 # timeout: 5s
69- # retries: 5
70+ # retries: 10
71+ # start_period: 30s
72+ # volumes:
73+ # - mysql_data:/var/lib/mysql
74+ # command: --default-authentication-plugin=mysql_native_password
7075
7176networks :
7277 app-network :
0 commit comments