#Prisma Migrate

5 messages · Page 1 of 1 (latest)

rapid linden
#

I have a docker-compose which sets up two services, a postgres container and a distroless container containing my app. How would you guys handle doing prisma migrate deploy? docker-compose.yml:

version: "3.9"
services:
  database:
    image: postgres:16.0-bookworm
    volumes:
      - db-data:/var/lib/postgresql/data
    container_name: bot-db
    environment:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_DB
  bot:
    build:
      context: .
      dockerfile: ./docker/bot/Dockerfile
      args:
        - DATABASE_URL=${DATABASE_URL}
    depends_on:
      - database
    container_name: discord-bot
    environment:
      - API_KEY
      - API_URL
      - DATABASE_URL
      - GUILD
      - TOKEN
      - SENTRY_DSN
volumes:
  db-data:```
elfin estuary
# rapid linden I have a docker-compose which sets up two services, a postgres container and a d...

Couldn't you just use the migration tutorial which prisma has?
I followed it and it works perfectly:
For my Nuxt 3 app I added this to my package.json:
"start:prod": "node ./.output/server/index.mjs",
"start:migrate:prod": "prisma migrate deploy && yarn run start:prod"

and in my DockerFile I have:
CMD [ "yarn", "run", "start:migrate:prod" ]

when I then start my docker compose stack it tries to apply the migrations (if they aren't deployed yet)

rapid linden
rapid linden
#

@young walrus Any chance I could get some help from you again?