Title
j

Jim

06/21/2018, 3:36 PM
Has anyone managed to deploy a Prisma service to Digital Ocean? The official docs arn’t up to date and I cant find any unofficial ones.
a

Andrew Mead

06/21/2018, 3:38 PM
Yes. What errors are you running into? Also, which docs were you trying to use? I didn't run into any issue with them as of two weeks ago.
I tried about a month ago and failed although I dont remember what the issue was. My understanding was the official docs wouldn’t work for the latest version of Prisma.
a

Andrew Mead

06/21/2018, 3:40 PM
Oh, with Digital Ocean. I haven't tried that. Sorry for the confusion.
j

Jim

06/21/2018, 3:42 PM
Sorry just realised it written Docker instead of Digital Ocean!
d

dpetrick

06/21/2018, 4:40 PM
What exactly are the errors you’re facing?
But I have different options:
$ prisma init hello-world
? Set up a new Prisma server or deploy to an existing server?

  Set up a new Prisma server for local development (based on docker-compose):
  Use existing database         Connect to existing database
  Create new database           Set up a local database using Docker

  Or deploy to an existing Prisma server:
  james/prisclust      Production Prisma cluster
  Demo server                   Hosted demo environment incl. database (requires login)
❯ Use other server              Manually provide endpoint of a running Prisma server
I tried with these settings:
james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo
$ prisma init hello-world
  ? Set up a new Prisma server or deploy to an existing server? Use other server
  ? Enter the endpoint of your Prisma server <tcp://159.12.34.17:2376>
    ? Choose a name for your service prisma2
  ? Choose a name for your stage dev

Created 2 new files:

prisma.yml           Prisma service definition
datamodel.graphql    GraphQL SDL-based datamodel (foundation for database)

Next steps:

  1. Open folder: cd hello-world
2. Deploy your Prisma service: prisma deploy
3. Read more about deploying services:
  <http://bit.ly/prisma-deploy-services>

    james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo
$ cd hello-world/

james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo/hello-world
$ prisma deploy
 ▸    <tcp://159.12.34.17:2376/prisma2/dev> is not a valid endpoint. It must start with http:// or https://

  Get in touch if you need help: <https://www.prisma.io/forum/>
  To get more detailed output, run $ export DEBUG="*"


   ╭─────────────────────────────────────╮
│                                     │
│   Update available 1.9.0 → 1.10.2   │
│    Run npm i -g prisma to update    │
│                                     │
╰─────────────────────────────────────╯


james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo/hello-world
$ prisma deploy
 ▸    Could not connect to server at <http://159.12.34.17:2376>. Please check if your server is running.

  Get in touch if you need help: <https://www.prisma.io/forum/>
  To get more detailed output, run $ export DEBUG="*"


   ╭─────────────────────────────────────╮
│                                     │
│   Update available 1.9.0 → 1.10.2   │
│    Run npm i -g prisma to update    │
│                                     │
╰─────────────────────────────────────╯


james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo/hello-world
As you can see I tried changing the endpoint in prisma.yaml ^
d

dpetrick

06/21/2018, 6:03 PM
what is the output of
docker ps
(assuming it is running in the DO context)?
j

Jim

06/21/2018, 6:06 PM
james at Jamess-MacBook-Pro-2 in ~/Projects/prisma/digital-ocean-demo/hello-world
$ docker ps
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                          PORTS                    NAMES
494b405b02d2        mysql:5.7                  "docker-entrypoint.s…"   About an hour ago   Up About an hour                0.0.0.0:3306->3306/tcp   prisma-db
626a9919890f        prismagraphql/prisma:1.3   "/app/bin/prisma-loc…"   About an hour ago   Restarting (1) 11 seconds ago                            digital-ocean-demo_prisma-database_1
prismagraphql/prisma seems to be stuck in a restart loop
d

dpetrick

06/21/2018, 6:09 PM
It’s probably a config issue. Grab the logs with
docker logs digital-ocean-demo_prisma-database_1
j

Jim

06/21/2018, 6:12 PM
Its this repeated a bunch of times
Listening for transport dt_socket at address: 8000
Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitution: application.conf @ jar:file:/app/lib/com.prisma.prisma-local-0.8.0-62757906db2b0a72da0d1336840e363f0c6925ca.jar!/application.conf: 54: Could not resolve substitution to a value: ${SCHEMA_MANAGER_SECRET}
	at com.typesafe.config.impl.ConfigReference.resolveSubstitutions(ConfigReference.java:111)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.ConfigDelayedMerge.resolveSubstitutions(ConfigDelayedMerge.java:132)
	at com.typesafe.config.impl.ConfigDelayedMerge.resolveSubstitutions(ConfigDelayedMerge.java:59)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:231)
	at com.typesafe.config.impl.SimpleConfig.resolveWith(SimpleConfig.java:78)
	at com.typesafe.config.impl.SimpleConfig.resolve(SimpleConfig.java:68)
	at com.typesafe.config.impl.SimpleConfig.resolve(SimpleConfig.java:41)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:214)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:182)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:259)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:256)
	at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:65)
	at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:92)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:256)
	at akka.actor.ActorSystem$.$anonfun$apply$4(ActorSystem.scala:241)
	at scala.Option.getOrElse(Option.scala:121)
	at akka.actor.ActorSystem$.apply(ActorSystem.scala:241)
	at akka.actor.ActorSystem$.apply(ActorSystem.scala:287)
	at akka.actor.ActorSystem$.apply(ActorSystem.scala:232)
	at com.prisma.local.PrismaLocalMain$.delayedEndpoint$com$prisma$local$PrismaLocalMain$1(PrismaLocalMain.scala:13)
	at com.prisma.local.PrismaLocalMain$delayedInit$body.apply(PrismaLocalMain.scala:12)
	at scala.Function0.apply$mcV$sp(Function0.scala:34)
	at scala.Function0.apply$mcV$sp$(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App.$anonfun$main$1$adapted(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.App.main(App.scala:76)
	at scala.App.main$(App.scala:74)
	at com.prisma.local.PrismaLocalMain$.main(PrismaLocalMain.scala:12)
	at com.prisma.local.PrismaLocalMain.main(PrismaLocalMain.scala)
d

dpetrick

06/21/2018, 6:14 PM
Oh. Your prisma version is ancient. Please use 1.10.2
This changes up things quite a bit - you have to provide a prisma config yml etc., and I don’t have the correct docs at hand at the moment.
j

Jim

06/21/2018, 6:15 PM
There are no correct docs I dont think!
d

dpetrick

06/21/2018, 6:16 PM
Basically as a starting point you can use the latest Prisma CLI to init a new service, take the docker compose and look at the generated configuration.
Maybe @nilan has quickly something at hand
d

Darryl

06/21/2018, 6:50 PM
I haven’t tried it, @Jim, but this looks like a good video on it.

https://www.youtube.com/watch?v=wTrPoeF-il0

j

Jim

06/21/2018, 6:52 PM
I have actually seen that. I was hoping it was possible to use Now for the business logic server, where as in that video he deploys everything to DO
d

Darryl

10/14/2019, 4:19 PM
Hi, @Jim. Apologies for bringing up an old thread but I just came across it again and wondered if you ended up deploying to Digital Ocean. I'm currently looking for the best place to deploy my simple Prisma app and as I have little experience with this stuff I'm wondering what's best. That is, running the server and db in a Docker container on a Droplet or keeping the server in a Droplet and running a (paid) managed database alongside in Digital Ocean. If you have any tips then I'd love to hear them. Thanks!
c

Chad H

10/19/2019, 2:25 AM
@Darryl I have been looking at this for several days. I tried managed DB on DO both PG and MySQL and I got following results DigitalOcean PG, it works fine but connection pooling doesn't work with prisma DigitalOcean MySQL, this is not an option at all. DO only has Mysql 8 and prisma does not support it I also tried scalegrid and it doesn't work there either. It keeps complainning about "require_secure_transport".
d

Darryl

10/19/2019, 5:14 AM
Hi, @Chad H. Oh, that's not good. Have you decided on something else then? I feel like other than throw a Docker container on a Droplet and run things like that, there are no other guides anywhere offering options of how to deploy Prisma apps.
Ideally, I want a managed DB on DO.
c

Chad H

10/19/2019, 10:36 AM
@Darryl I haven't pushed to production yet so for now I'm okay with mysql docker but from my research so far, I don't think managed DB on DO is an option for prisma (hoping someone smarter than me will disagree with this and show me it can be done). I'll be doing some tests on lightsail next. I will come back and let you know how it goes.
d

Darryl

10/19/2019, 3:03 PM
That'd be great. Thank you, Chad. I'm in a similar position in that I'm not ready for production yet but I'm getting relatively close now (it'll be this year). I really hope we can get some advice on this situation from somebody in the know. Anyway, have a nice weekend! 👍
Hi, @divyendu. If you have a moment, could you please check the last few messages here (anything before that is very old) and see if you could give any advice. Thanks!
d

divyendu

10/21/2019, 8:49 AM
DigitalOcean PG, it works fine but connection pooling doesn't work with prisma
IDK why pooling won't work, Prisma 1 makes a connection pool internally 🤔
DigitalOcean MySQL, this is not an option at all. DO only has Mysql 8 and prisma does not support it
This sounds correct, I didn't know that they only support MySQL 8
I also tried scalegrid and it doesn't work there either. It keeps complainning about "require_secure_transport".
SSL and Prisma 1 with Postgres should work, you might need to provide specific SSL options. Not sure why it didn't work for you.
So, PG + DO + Prisma 1 should just work.
d

Darryl

10/21/2019, 9:00 AM
Thanks. I've built everything on PG so far so that's a bit of a pain. I had no idea until recently that I'd have an issue with MySQL.
d

divyendu

10/21/2019, 9:01 AM
Thanks. I've built everything on PG so far so that's a bit of a pain. I had no idea until recently that I'd have an issue with MySQL.
Hosted MySQL on RDS for example is an option!
c

Chad H

10/21/2019, 9:27 AM
@divyendu I was referring to pgbouncer connection pooling. I could not get prisma to work with this. I believe it's this issue here: https://github.com/prisma/prisma/issues/4321. PG + DO + Prisma1 works fine as long as we do not use pgbouncer.
👍 1
@Darryl I tested MySQL on AWS and it works fine. Just be sure to use v5.7. In the other vendor I tested (scalegrid), I had to provide certificate for the SSL connection. So I think AWS will be the better option since I can use private IP.
👍 1