这是我已经完成的步骤
prisma init
我在本地(不存在)中为数据库设置了 postgresql。
它创建了 3 个文件,datamodel.graphql、docker-compose.yml、prisma.yml
docker-compose up -d
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.
我所做的只是手册中描述的标准操作,没有自定义https://www.prisma.io/docs/tutorials/deploy-prisma-servers/local-(docker)-meemaesh3k 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
我缺少什么?
我找到了这个解决方案来解决我面临的同样问题
docker-machine ip default
使用此地址并使用上述命令将“localhost”替换为 IP,以便在 prisma.yml 文件中看起来像这样
endpoint: http://1xx.1xx.xx.xxx:4466
答案是从这里引用的GitHub 链接 https://github.com/prisma/prisma/issues/2675#issuecomment-400326500
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)