Sign inSign up

prismagraphql/prisma

By prismagraphql

•Updated almost 7 years ago

The Data Layer for Modern Applications

Image
84

50M+

prismagraphql/prisma repository overview

Prisma is a performant open-source infrastructure layer simplifying databases workflows. Learn how to get started with Prisma here⁠.

⁠Common workflows

The Docker CLI⁠ and Docker Compose CLI⁠ are used to manage the Prisma servers.

Here's a quick rundown of the most important commands:

Note that these commands need to be executed in the directory where the Docker Compose file for your Prisma server is available.

⁠Docker Compose file

Here is an overview of all properties you need to configure on the prisma Docker image inside your Docker Compose file. The all-uppercase words represent placeholders for the configuration variables you need to provide for your Prisma setup.

version: '3'
services:
  prisma:
    image: prismagraphql/prisma:__LATEST_PRISMA_VERSION__
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        managementApiSecret: __YOUR_MANAGEMENT_API_SECRET__
        port: __YOUR_PRISMA_SERVER_PORT__
        databases:
          default:
            connector: __YOUR_DATABASE_CONNECTOR__
            migrations: __ENABLE_DB_MIGRATIONS__
            host: __YOUR_DATABASE_HOST__
            port: __YOUR_DATABASE_PORT__
            user: __YOUR_DATABASE_USER__
            password: __YOUR_DATABASE_PASSWORD__

Most notably most of your configuration takes place in the PRISMA_CONFIG environment variable.

⁠PRISMA_CONFIG reference
⁠Root properties

These are the root properties of PRISMA_CONFIG:

KeyTypeDescription
managementApiSecretstringThe Management API secret is used by the Prisma CLI to generate authentication tokens and authenticate its requests against the Prisma server. Example: mysecret42
portnumberThe port on which the Prisma server is running. Example: 4466
databasesobjectSpecifies to which databases the Prisma server should connect to.
⁠Database properties

Each database object in the databases object needs to include the following properties:

KeyTypeDescription
hoststringThe IP address or URL of the machine hosting the database. Example: 127.0.0.1
portnumberThe post where the database is running.
user stringThe database user. Example: root
password stringThe password for the database user specified in user. Example: myDBpassword42

⁠Debugging

To get insights into the internals of your Prisma server, you can check the logs of the Docker container.

⁠Accessing Docker logs

View the raw logs from the running Docker containers:

docker-compose logs
⁠Verify Docker containers

Verify that the containers are running:

docker ps

You should see an output similar to this:

$ docker ps
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                    NAMES
2b799c529e73        prismagraphql/prisma:1.7            "/bin/sh -c /app/sta…"   17 hours ago        Up 7 hours          0.0.0.0:4466->4466/tcp   myapp_prisma_1
757dfba212f7        mysql:5.7                           "docker-entrypoint.s…"   17 hours ago        Up 7 hours          3306/tcp                 prisma-db

This is helpful when you're getting an error message saying Error response from daemon: No such container.

⁠Hard resetting the Docker environment

If your local Prisma server is in an unrecoverable state, it might be necessary to completely reset it:

docker-compose kill
docker-compose down
docker-compose up -d

⁠Documentation

Read more about Prisma in the official documentation⁠.

Tag summary

Content type

Image

Digest

Size

126.5 MB

Last updated

almost 7 years ago

docker pull prismagraphql/prisma:1.34.9-gatsby