- 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.ymlwith 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
managementApiSecretwhich you will put in your .env file. -
Run
docker-compose up -dwhich 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 serverand 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.hellothen a stage e.g.dev -
cd hello-worldopen your.envfile or create one if it doesn't exist and make sure it has the variablePRISMA_MANAGEMENT_API_SECRETwith the same API secret fromdocker-compose.yml -
prisma deployand wait for it to finish and open the following webpage:
http://<linode_public_io>:4466/hello/dev

To get
/generated/prisma.graphqlfirst install the GraphQL CLI and run the init command:graphql initthis will generate a new file called.grapqhqlconfig.yamland make sure it looks similar to:Then copy into
prisma.yml: