invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
420 stars 268 forks source link

Database not connecting to app container #487

Closed magicman32 closed 1 year ago

magicman32 commented 1 year ago

Setup information

docker compose up -d

Describe the bug Database is not connecting

To reproduce Steps to reproduce the behavior:

  1. Go to '...portainer to check logs

  2. Click on '....database container

  3. Scroll down to '....'

  4. See error

  5. database-container-ninja

  6. Click on.....app container

  7. Click on logs

  8. see error

  9. app-container-ninja

Expected behavior Database to connect.......

docker-compose.yml (db section) db: image: mysql:8

ports:
  - "3305:3306"
restart: always
env_file: env
volumes:
  - ./docker/mysql/data:/var/lib/mysql:rw,delegated

env (file

DB connection

DB_HOST=db DB_PORT=3306 DB_DATABASE=ninja DB_USERNAME=ninja DB_PASSWORD=ninja

is db_port in env file meant to match 3305 in docker compose

Sorry, this is my first time doing one of these

Xenion1987 commented 1 year ago

Please post your complete docker-compose.yml file. I know this behavior while I was testing different networks within the docker-compose.yml file.

You could also try to resolve the database DNS name by yourself by executing

docker compose exec app ping -c1 db

As long as there is no error while trying to resolve the hostname, the network config should be OK.

magicman32 commented 1 year ago

its fixed now it was a file permissions I overlooked on project page

Xenion1987 commented 1 year ago

@turbo124 Issue can be closed