Back

Docker Compose, Prisma and the M1

Pointers,

Everything else is pretty much standard docker compose

version: '3.9'

services:
  app:
    container_name: app
    build: .
    ports:
      - '4321:4321'
    depends_on:
      - db
    links:
      - db
    env_file:
      - .env
    environment:
      DATABASE_URL: 'postgres://postgres:password@db/scirque?connect_timeout=300'
  db:
    container_name: db
    image: postgres:13-alpine
    expose:
      - 5432
    environment:
      POSTGRES_PASSWORD: 'password'
      POSTGRES_DB: 'dbname'
    volumes:
      - pgdata1:/var/lib/postgresql/data

volumes:
  pgdata1: {}

This post is a simple note for me for future, since I ended up spending quite a bit of time researching as to why the prisma client wouldn't connect in the docker compose during migration commands but work when the application is run in the same composed container.