Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Connections Fails #6

Open
nonlinearsugar opened this issue Aug 27, 2022 · 1 comment
Open

Database Connections Fails #6

nonlinearsugar opened this issue Aug 27, 2022 · 1 comment

Comments

@nonlinearsugar
Copy link

nonlinearsugar commented Aug 27, 2022

I wasn't able to connect to my database with my docker compose file. I received the error: "php_network_getaddresses: getaddrinfo failed: Name or service not known"

I ended up having to hard code my database parameters into /var/www/html/inc/conf.php and setting the INSTALL mode to false. Following this I was able to establish a DB connection and complete setup.

Here's the compose file (usernames and passwords intentionally blanked out):

version:  '3.3'
services:
   hashtopolis:
       container_name:  hashtopolis
       image:  kpeiruza/hashtopolis:latest
       restart:  unless-stopped
       environment:
           MYSQL_HOST:  mariadb10
           MYSQL_PORT:  3306
           MYSQL_DB:  hashtopolis
           MYSQL_USER:  
           MYSQL_PASSWORD:  
           H8_USER:  
           H8_PASS:  
           H8_EMAIL:  root@localhost
       volumes:
           -  hashtopolis_import:/var/www/html/import
           -  hashtopolis_files:/var/www/html/files
           -  hashtopolis_inc:/var/www/html/inc
           -  hashtopolis_locks:/var/www/html/inc/utils/locks
       expose:
           -  '80/tcp'
volumes:
   hashtopolis_import:
       name:  hashtopolis_import
   hashtopolis_files:
       name:  hashtopolis_files
   hashtopolis_inc:
       name:  hashtopolis_inc
   hashtopolis_locks:
       name:  hashtopolis_locks
networks:
   default:
       external:
           name:  nginx-proxy

@Gitoffomalawn
Copy link
Contributor

Gitoffomalawn commented May 5, 2023

I ended up having to hard code my database parameters into /var/www/html/inc/conf.php and setting the INSTALL mode to false. Following this I was able to establish a DB connection and complete setup.

Hardcoding the variables isn't necessary. The real fix is switching to MariaDB, which solves all the MySQL problems. You'll have to wait a little after initial startup (up to a few minutes, depending on your system) for it to create the initial DB and prune the /install folder. After that, you're golden.

You should be able to monitor progress with docker logs <HTP CONTAINER NAME> -f. It'll tell you when it's pruned the /install folder. Not need for hardcoding anything. You'll need to change some permissions on your mapped volumes, though, or else it might not let you upload files.

I've put in a PR with some changes (including some additional environment parameters) to get a working setup.

ETA: PR was merged. The docker-compose.yaml as is now should work just fine, without any workarounds. This issue can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants