timothyjmiller/prisma-studio

By timothyjmiller

β€’Updated about 4 years ago

Image
2

1M+

timothyjmiller/prisma-studio repository overview

β πŸ’ΎπŸ’Ώ Prisma Studio (for Docker)

Access Prisma Studio through your web browser.

⁠Best Security Practices

  • Host your different postgres environments in separate docker containers!
  • Share database access on a per environment basis

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⁠

β πŸ“Š Stats

SizeDownloadsDiscord
prisma-studio docker image sizeTotal DockerHub pullsOfficial Discord Server

⁠⁉️ How Private & Secure?

  1. Alpine Linux base image
  2. Docker runtime
  3. Open source for open audits
  4. Regular updates
  5. Zero extra dependencies

⁠πŸ–₯️ Supported Architectures

At the time of this writing, @prisma/cli only supports AMD64

ARM64 support will come shortly after Prisma officially supports it.

Relevant Github Issue⁠

⁠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

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

β πŸ“ 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
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.

⁠☁️ Enterprise Deployments

For advanced deployments and/or consulting, email me⁠ or contact me on Discord⁠

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 πŸ’»β 

Tag summary

Content type

Image

Digest

Size

405.7 MB

Last updated

about 4 years ago

docker pull timothyjmiller/prisma-studio