Prisma Deploy Docker错误“无法连接到服务器”; [英] Prisma Deploy Docker error "Could not connect to server"

查看:179
本文介绍了Prisma Deploy Docker错误“无法连接到服务器”;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我已经完成的步骤

prisma init

我在本地设置数据库的PostgreSQL(不存在)。

I set postgresql for database in my local(not exist).

它创建了3个文件,datamodel.graphql ,docker-compose.yml,prisma.yml

It created 3 files, datamodel.graphql, docker-compose.yml, prisma.yml

docker-compose up -d

我确认它已成功运行

但是如果我叫 prisma deploy ,它向我显示错误

I confirmed it running successfully But if I call prisma deploy, it shows me error

Could not connect to server at http://localhost:4466. Please check if your server is running.

我所做的只是手册中描述的标准操作,并且
< a href = https://www.prisma.io/docs/tutorials/deploy-prisma-servers/local-(docker)-meemaesh3k rel = noreferrer> https://www.prisma.io/docs/ tutorials / deploy-prisma-servers / local-(docker)-meemaesh3k

All I have done is standard operation described in manual and there is no customization in https://www.prisma.io/docs/tutorials/deploy-prisma-servers/local-(docker)-meemaesh3k

这是docker-compose.yml

And this is docker-compose.yml

version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.11
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
        databases:
          default:
            connector: postgres
            host: localhost
            port: '5432'
            database: databasename
            schema: public
            user: postgres
            password: root
            migrations: true

我丢失了什么?

推荐答案

文档提及


docker ps

您应该看到类似于以下的输出:

You should see 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  


(此处显示为mysql,但也适用于postgresql)

(Here shown with mysql, but valid with postgresql too)

要点是:应该运行两个 个容器,而不是一个。

The point is: there should be two containers running, not one.

检查 docker-compose日志来查看为什么第二个(数据库)没有启动。

Check docker-compose logs to see why the second one (database) did not start.

这篇关于Prisma Deploy Docker错误“无法连接到服务器”;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆