- SSH to server
- Install Docker and Docker Compose:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- Install Node:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
- Install Prisma CLI
npm -g install prisma
- Create
docker-compose.yml
with the following content:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.12
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
managementApiSecret: my-secret
databases:
default:
connector: mysql
host: mysql
port: 3306
user: root
password: prisma
migrations: true
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: prisma
volumes:
- mysql:/var/lib/mysql
volumes:
mysql:
-
Make sure you create a
managementApiSecret
which you will put in your .env file. -
Run
docker-compose up -d
which will fetch the Docker images for Prisma and MySQL -
Verify containers with
docker ps
-
Bootstrap a new Prisma service with
prisma init hello-world
-
Select
Use other server
and it'll prompt for your Prisma Server endpoint, enter the public IP of your Linode with the Prisma port e.g. http://<linode_public_ip>:4466, hit enter and provide a service name e.g.hello
then a stage e.g.dev
-
cd hello-world
open your.env
file or create one if it doesn't exist and make sure it has the variablePRISMA_MANAGEMENT_API_SECRET
with the same API secret fromdocker-compose.yml
-
prisma deploy
and wait for it to finish and open the following webpage:
http://<linode_public_io>:4466/hello/dev
To get
/generated/prisma.graphql
first install the GraphQL CLI and run the init command:graphql init
this will generate a new file called.grapqhqlconfig.yaml
and make sure it looks similar to:Then copy into
prisma.yml
: