Skip to content

timothymiller/docker-prisma-studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

70 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’พ Prisma Studio (for Docker)

Access Prisma Studio securely through your web browser.

Share multiple database environments' access with colleagues. Deployed via Traefik for global access.

๐Ÿ“Š Stats

Size Downloads Discord
prisma-studio docker image size Total DockerHub pulls Official Discord Server

โ‰๏ธ How Private & Secure?

  1. ๐Ÿชจ Stable Debian-slim base image
  2. ๐Ÿ”’ 100% Docker Bench Security compliant
  3. ๐Ÿ‘จโ€๐Ÿ’ป Open source for open audits
  4. ๐Ÿ“ˆ Regular updates
  5. 0๏ธ No extra dependencies

๐Ÿ–ฅ๏ธ Supported Architectures

ARM64, ARMv7, x86, x64, PPC

How it Works

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.

๐Ÿ‘จโ€๐Ÿ’ป Deploying

โš ๏ธ Prerequisites

Traefik v2 network

Setting up an on-premise HTTPS reverse proxy requires knowledge of Traefik v2. This is a great starting point.

For help setting up an on-premise or cloud-agnostic HTTPS reverse proxy for Kubernetes, email me or contact me on Discord

๐Ÿ“ Environment Variables

โš ๏ธ Warning

Make sure you securely generate new passwords for your postgres database for use with Prisma Studio.

  1. Create a file named .env

  2. Give .env the following contents:

PROJECT_NAME=demo-project
DOMAIN_NAME=domain.com
POSTGRES_DATABASE=development
POSTGRES_HOST=postgres
POSTGRES_PATH=/your/path/
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432
POSTGRES_DEFAULT_PORT=5432
POSTGRES_IP_ADDRESS=192.168.254.20
PRISMA_STUDIO_PORT=5555
PRISMA_STUDIO_IP_ADDRESS=192.168.254.21
NETWORK_NAME=traefik_proxy

You may have to change the port numbers for Postgres & Prisma Studio depending on the availability of your host machine.

โ˜๏ธ Enterprise Deployments

For DevOps help setting up an on-premise or cloud-agnostic environment for software engineers, email me or contact me on Discord

For example, before deploying this in a production environment, you will want to setup Traefik middleware for authentication to limit database access.

Create three .env configs

  1. development
  2. testing
  3. production

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.

License

This Template is licensed under the GNU General Public License, version 3 (GPLv3).

Author

Timothy Miller

View my GitHub profile ๐Ÿ’ก

View my personal website ๐Ÿ’ป