Docker Community Forums

Share and learn in the Docker community.

Problems when spawning a docker container with prismagraphql

Trying to start containers with my docker-compose file:

version: "3"
services:
  prisma:
    image: prismagraphql/prisma:1.20
    restart: always
    ports:
      - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        managementApiSecret: my-secret
        databases:
          default:
            connector: mysql
            host: mysql
            port: 3306
            user: root
            password: prisma
            migrations: true
  mysql:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: prisma
    volumes:
      - mysql:/var/lib/mysql
volumes:
  mysql

when executing “docker-compose up -d” my prismagraphql/prisma container is not able to connect to the database. This is the error message from “docker logs <prismagraphql/prisma container id>” :

Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=mysql)(port=3306)(type=master) : Connection refused (Connection refused)

This error is then looped

Anyone with a solution for this?

Here are people with the same problem executing docker containers with prisma: