Jonathan Demirgian
05/11/2019, 7:48 PMprisma init Docker example built into the Prisma CLI doesn't work. Here's the standard boilerplate setup in an empty dir:
Jonathans-Air:prismaex lirum$ ls
Jonathans-Air:prismaex lirum$ prisma init
? Set up a new Prisma server or deploy to an existing server? Create new database
? What kind of database do you want to deploy to? MySQL
? Select the programming language for the generated Prisma client Prisma JavaScript Client
Created 3 new files:
prisma.yml Prisma service definition
datamodel.prisma GraphQL SDL-based datamodel (foundation for database)
docker-compose.yml Docker configuration file
Next steps:
1. Start your Prisma server: docker-compose up -d
2. Deploy your Prisma service: prisma deploy
3. Read more about Prisma server:
<http://bit.ly/prisma-server-overview>
Generating schema... 25ms
Saving Prisma Client (JavaScript) at /Users/lirum/Documents/programming/projects/learndocker/ex5/prismaex/generated/prisma-client/
╭──────────────────────────────────────╮
│ │
│ Update available 1.32.0 → 1.32.2 │
│ Run npm i -g prisma to update │
│ │
╰──────────────────────────────────────╯
Jonathans-Air:prismaex lirum$ ls
datamodel.prisma docker-compose.yml generated prisma.yml
Jonathans-Air:prismaex lirum$ docker-compose up -d
Creating network "prismaex_default" with the default driver
Creating prismaex_mysql_1 ... done
Creating prismaex_prisma_1 ... done
Jonathans-Air:prismaex lirum$
Cool, so they're running and I can check with `docker ps`:
Jonathans-Air:prismaex lirum$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3421e8b8f214 prismagraphql/prisma:1.32 "/bin/sh -c /app/sta…" 4 minutes ago Up 4 minutes 0.0.0.0:4466->4466/tcp prismaex_prisma_1
dba528e010a4 mysql:5.7 "docker-entrypoint.s…" 4 minutes ago Up 4 minutes 3306/tcp, 33060/tcp prismaex_mysql_1
Jonathans-Air:prismaex lirum$
But when I checkout the playground at localhost:4466 in my browser, I'm show a "Server cannot be reached" error message (attached).
This is not what I should be seeing, right? I should be able to inspect the schema from this Playground?Jonathan Demirgian
05/11/2019, 7:53 PMJonathans-Air:prismaex lirum$ docker-compose logs
Attaching to prismaex_prisma_1, prismaex_mysql_1
prisma_1 | No log level set, defaulting to INFO.
prisma_1 | [INFO] {} - Started.
prisma_1 | [INFO] {} - Started.
prisma_1 | [INFO] {} - Close initiated...
prisma_1 | [INFO] {} - Closed.
prisma_1 | [INFO] Initializing workers...
prisma_1 | [INFO] Obtaining exclusive agent lock...
prisma_1 | [INFO] Obtaining exclusive agent lock... Successful.
prisma_1 | [INFO] Successfully started 1 workers.
prisma_1 | [INFO] Deployment worker initialization complete.
prisma_1 | Server running on :4466
mysql_1 | 2019-05-11T19:40:36.312944Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1 | 2019-05-11T19:40:36.316582Z 0 [Note] mysqld (mysqld 5.7.26) starting as process 1 ...
mysql_1 | 2019-05-11T19:40:36.322954Z 0 [Note] InnoDB: PUNCH HOLE support available
mysql_1 |
--- snipping lots of initialization code ---
2019-05-11T19:40:36.644296Z 0 [Note] mysqld: ready for connections.
mysql_1 | Version: '5.7.26' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)Jonathan Demirgian
05/11/2019, 8:17 PMenvironment:
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: mysql
host: mysql
user: root
password: prisma
rawAccess: true
port: 3306
migrations: true
NODE_ENV: "development" Still receiving a "cannot find server" error from the Playground.Jonathan Demirgian
05/11/2019, 8:30 PMprisma deploy doing, and why does it show "Server cannot be reached" if the server is most definitely online? Why not something like "Schema cannot be found"?Sávio Serra
05/11/2019, 10:01 PMJeany Meza
05/12/2019, 1:48 AMJeany Meza
05/12/2019, 1:50 AM