DONE: fix mysql service cannot communicate
Build Docker Image / build-backend (push) Successful in 11s
Build Docker Image / build-backend (push) Successful in 11s
This commit is contained in:
+3
-2
@@ -1,9 +1,10 @@
|
|||||||
# Host ports (change these if they collide on your single server)
|
# Host ports (change these if they collide on your single server)
|
||||||
BACKEND_HOST_PORT=8080
|
BACKEND_HOST_PORT=8080
|
||||||
MYSQL_HOST_PORT=3306
|
# MySQL is internal-only (not published to the host)
|
||||||
|
|
||||||
# MySQL
|
# MySQL
|
||||||
MYSQL_ROOT_PASSWORD=password
|
# Quote if the password contains special chars like ; # $
|
||||||
|
MYSQL_ROOT_PASSWORD="password"
|
||||||
MYSQL_DATABASE=qms
|
MYSQL_DATABASE=qms
|
||||||
|
|
||||||
# App
|
# App
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
# Host ports (change these if they collide on your single server)
|
# Host ports (change these if they collide on your single server)
|
||||||
BACKEND_HOST_PORT=8080
|
BACKEND_HOST_PORT=8080
|
||||||
MYSQL_HOST_PORT=3306
|
# MySQL is internal-only (not published to the host)
|
||||||
|
|
||||||
# MySQL
|
# MySQL
|
||||||
MYSQL_ROOT_PASSWORD=R8qjjBJDg9NtL2IwcnoFMkn8pktwAZ;wsl
|
MYSQL_ROOT_PASSWORD="R8qjjBJDg9NtL2IwcnoFMkn8pktwAZ;wsl"
|
||||||
MYSQL_DATABASE=qms
|
MYSQL_DATABASE=qms
|
||||||
|
|
||||||
# App
|
# App
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ services:
|
|||||||
image: mysql:8
|
image: mysql:8
|
||||||
container_name: qms-mysql
|
container_name: qms-mysql
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
# Do not publish 3306 to the host — avoids clashes with host MySQL.
|
||||||
# Host port can be changed via MYSQL_HOST_PORT in .env (default 3306)
|
# Backend reaches it as hostname "mysql" on the internal Docker network.
|
||||||
- "${MYSQL_HOST_PORT:-3306}:3306"
|
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-password}
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-password}
|
||||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-qms}
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-qms}
|
||||||
|
|||||||
Reference in New Issue
Block a user