diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml index 65eb66b..7ea06a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index d37c28c..2e0e9ef 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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