I'm trying to implement a microservice architecture where every microservice has its' own database. I'm using prisma as a data access layer between my services and a single database server. Since I have a single database server I want each prisma instance to access its' own database on this server, but I didn't find an option to specify name of a database used by particular prisma instance.
So here's the question. Is there a way to specify a database name for prisma instance?
Here's my docker-compose.yml file if it's helpful:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.14
restart: always
ports:
- "${PRODUCT_PRISMA_PORT}:${PRODUCT_PRISMA_PORT}"
environment:
PRISMA_CONFIG: |
port: ${PRODUCT_PRISMA_PORT}
managementApiSecret: ${PRODUCT_PRISMA_SECRET}
databases:
product:
connector: postgres
host: postgres
port: 5432
user: prisma
password: prisma
migrations: true
postgres:
image: postgres:11-alpine
restart: always
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
volumes:
- /var/lib/postgresql/data
product-app:
command: yarn start
image: product-web
volumes:
- ./product-service:/usr/app
ports:
- "${PRODUCT_APP_PORT}:${PRODUCT_APP_PORT}"
depends_on:
- prisma
environment:
PORT: ${PRODUCT_APP_PORT}
PRISMA_ENDPOINT: ${PRODUCT_PRISMA_ENDPOINT}