Setting up Docker always trying to connect to MySQL

I am trying to set up dreamfactory in a docker environment for evaluation purposes, in the documentation there is listed that I can set it up using postgress.

I have built a Container, with Dreamfactory, pgadmin and a postgres instance.
Unfortunatly during starting up dream factory is trying to connect to a MySql server

dreamfactory | mysql-c INFO Trying to connect to MySQL server

even though in my compose file I am setting it to connect to a postgress

dreamfactory:
image: dreamfactorysoftware/df-docker
container_name: dreamfactory
restart: always
ports:
- “8080:80”
depends_on:
- postgres
environment:
- DB_CONNECTION=pgsql
- DB_HOST=postgres
- DB_PORT=5432
- DB_DATABASE=dreamfactory
- DB_USERNAME=dreamfactory
- DB_PASSWORD=yourpassword
- APP_KEY=base64:d1075a9a-a483-4003-b3b9-ce5d025c1045
volumes:
- dreamfactory_storage:/opt/dreamfactory/storage
networks:
- backend

Hey!

What does sudo docker-compose exec dreamfactory cat .env | grep DB_CONNECTION return? it should be: DB_CONNECTION=pgsql

You can Explicitly Set the Database Type

Make sure your docker-compose.yml file contains:

environment:

  • DB_CONNECTION=pgsql
  • DB_HOST=postgres
  • DB_PORT=5432
  • DB_DATABASE=dreamfactory
  • DB_USERNAME=dreamfactory
  • DB_PASSWORD=yourpassword
  • DF_DB_CONNECTION=pgsql # <— Add this line to force PostgreSQL
  • DF_DATABASE_DRIVER=pgsql # <— Ensure PostgreSQL driver is selected
  • APP_KEY=base64:d1075a9a-a483-4003-b3b9-ce5d025c1045

Hi,
I ended up finding what the issue was in the env variables there are 3 variables to indicate which DB to use

  - DREAMFACTORY_ENABLE_MARIADB_SERVICE=yes
  - DREAMFACTORY_ENABLE_MONGODB_SERVICE=no
  - DREAMFACTORY_ENABLE_POSTGRESQL_SERVICE=no