MySQL running on host.

This commit is contained in:
mguschin
2026-02-03 21:03:20 +03:00
parent 6b54303482
commit 94271ddfb3
3 changed files with 5 additions and 10 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.env

View File

@@ -10,7 +10,7 @@ services:
XMPP_DOMAIN: ${XMPP_DOMAIN}
XMPP_USER: ${XMPP_USER}
XMPP_PASSWORD: ${XMPP_PASSWORD}
MYSQL_HOST: ${MYSQL_HOST:-mysql}
MYSQL_HOST: ${MYSQL_HOST:-host.docker.internal}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
@@ -23,8 +23,6 @@ services:
- ./data/prosody:/var/lib/prosody
- ./logs/prosody:/var/log/prosody
- ./data/prosody/configuration:/etc/prosody/conf.d
networks:
- mysql_network
restart: unless-stopped
mem_limit: 200M
healthcheck:
@@ -33,8 +31,3 @@ services:
timeout: 10s
retries: 3
start_period: 40s
networks:
mysql_network:
external: true
name: mysqlgit_mysql_network

View File

@@ -24,9 +24,10 @@ if [ -n "$MYSQL_HOST" ]; then
if [ $counter -eq $MYSQL_TIMEOUT ]; then
echo "ERROR: MySQL at $MYSQL_HOST:$MYSQL_PORT did not become ready within ${MYSQL_TIMEOUT} seconds"
echo "Please check that:"
echo " - MySQL container is running"
echo " - Both containers are on the same Docker network"
echo " - MySQL server is running on the host"
echo " - MySQL is listening on port $MYSQL_PORT"
echo " - MYSQL_HOST environment variable is correctly set"
echo " - Firewall allows connection to MySQL port"
exit 1
fi