chakrihacker
05/12/2018, 7:42 AMKyleG
05/12/2018, 6:26 PMprisma init
on an empty directory (select "Create new Database" and MySQL), that should give you a file called docker-compose.yml that looks like this:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.8
restart: always
ports:
- "4466:4466"
environment:
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
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:
A good place to put that file in your server project is under the directory ./database
if that's what you've got.
Make sure you have a .env file that looks something like this:
PRISMA_STAGE="dev"
PRISMA_ENDPOINT="<http://self:4466/server/dev>"
PRISMA_CLUSTER="local"
PRISMA_SECRET="SOME_PRISMA_SECRET"
APP_SECRET="SOME_APP_SECRET"
PRISMA_MANAGEMENT_API_SECRET="SOME_PRISMA_MANAGEMENT_API_SECRET"
Then bring the server up with docker-compose -f ./database/docker-compose.yml up -d
(-f names the file, up brings it "up", and -d puts it in the background).
Actually perhaps take a look at my personal project's Readme, I basically wrote notes to myself on .env: https://github.com/TiE23/metric-teacher/tree/master/serverKyleG
05/12/2018, 6:31 PMdocker ps
and from there you can shell into the mysql container with this:
docker exec -it database_db_1 mysql -u root --host localhost --port 4466 --password=prisma -D server@dev
(database_db_1
is the container name, it might be different for you. server@dev
is the project name and stage, it might be different for you)chakrihacker
05/30/2018, 6:10 PM