prisma-studio
Access Prisma Studio through your web browser.
Useful for sharing multiple database environments' access with colleagues. Can be deployed via Traefik for global access.
For advanced deployments and/or consulting, email meβ or contact me on Discordβ
At the time of this writing, @prisma/cli only supports AMD64
ARM64 support will come shortly after Prisma officially supports it.
A docker container with the latest LTS of NodeJS and the @prisma/cli module introspects your postgres database to auto-generate a prisma schema in the form schema.prisma.
Prisma Studio is then made available at the port specified to display your data source.
Use the included docker-compose.yml file as a base for your installation.
version: '3.7'
services:
prisma-studio:
container_name: prisma-studio
image: timothyjmiller/prisma-studio:latest
restart: unless-stopped
env_file:
- .env
ports:
- ${PRISMA_STUDIO_PORT}:5555
postgres:
container_name: prisma-postgres
image: postgres:alpine
restart: always
env_file:
- .env
ports:
- ${POSTGRES_PORT}:5432
volumes:
- ${POSTGRES_PATH}/${PROJECT_NAME}/${POSTGRES_DATABASE}/:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
Make sure you securely generate new passwords for your postgres database for use with Prisma Studio.
Create a file named .env
Give .env the following contents:
PROJECT_NAME=demo-project
POSTGRES_DATABASE=development
POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432
PRISMA_STUDIO_PORT=5555
POSTGRES_PATH=/postgres
You may have to change the port numbers for postgres & Prisma Studio depending on the availability of your host machine.
For advanced deployments and/or consulting, email meβ or contact me on Discordβ
Create three .env configs
Each config should have it's own database name (development, testing, and production), port number, plus unique passwords for each environment. Securely store the Postgres database credentials for safe-keeping.
This Template is licensed under the GNU General Public License, version 3 (GPLv3).
Timothy Miller
Content type
Image
Digest
Size
405.7 MB
Last updated
about 4 years ago
docker pull timothyjmiller/prisma-studio