gpt4 book ai didi

docker - Prisma部署Docker错误 “Could not connect to server”

转载 作者:行者123 更新时间:2023-12-04 14:38:29 27 4
gpt4 key购买 nike

这是我已经完成的步骤

prisma init

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

它创建了3个文件,分别是datamodel.graphql,docker-compose.yml,prisma.yml
docker-compose up -d

我确认它成功运行
enter image description here
但是,如果我调用 prisma deploy,它会向我显示错误
Could not connect to server at http://localhost:4466. Please check if your server is running.

我所做的只是手册中描述的标准操作,并且在其中没有自定义
https://www.prisma.io/docs/tutorials/deploy-prisma-servers/local-(docker)-meemaesh3k

这是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

我想念什么?

最佳答案

documentation mentions:

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)

关键是:应该有两个正在运行的容器,而不是一个。

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

关于docker - Prisma部署Docker错误 “Could not connect to server”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51334907/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com