Current behavior
I'm following the new guides for 1.7 and I can't get the docker-compose.yml file right. When I run docker-compose up -d I get
ERROR: The Compose file './deployment/docker-compose.yml' is invalid because:
services.prisma.environment.PRISMA_CONFIG contains {"port": 4466, "databases": {"default": {"connector": "mysql", "managementApiSecret": "local-dev-secret", "active": true, "host": "db", "
port": 3306, "user": "root", "password": "prisma"}}}, which is an invalid type, it should be a string, number, or a null
https://github.com/graphcool/prisma/issues/new?template=bug.md
Reproduction
Run docker-compose up -d with the docker-compose.yml example file here: https://www.prisma.io/docs/reference/upgrade-guides/upgrading-prisma/upgrade-to-1.7-iquaecuj6b#deprecating-local-commands
Expected behavior?
I expect it to create a local docker cluster to deploy to.
If I turn the whole PRISMA_CONFIG object into a string it deploys but then it fails due to some complaint about connector
I managed to get it working by adding a pipe in the PRISMA_CONFIG like this:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.7
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
databases:
default:
connector: mysql
active: true
host: db
port: 3306
user: root
password: prisma
managementApiSecret: my-server-secret-123
db:
image: mysql:5.7
restart: always
environment:
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: prisma
See more at https://stackoverflow.com/questions/15540635/what-is-the-use-of-pipe-symbol-in-yaml
Thanks @lucasmafra that was super helpful. I got mine working too with that tip.
I just opened a PR suggesting a fix in the docs #2257
Thanks for providing the PR @lucasmafra 馃檹
Most helpful comment
I managed to get it working by adding a pipe in the PRISMA_CONFIG like this:
See more at https://stackoverflow.com/questions/15540635/what-is-the-use-of-pipe-symbol-in-yaml