How to run generate & migrate in production on a VPS for SQLite Database?
So I have a database in development that I run
db:generate
& db:migrate
on to create the database & then run my app that uses it.
But how do I do that in production when I can't run direct commands. I'm using https://easypanel.io on a self-hosted VPS.
Do I just use pre-scripts or post-scripts? What is the recommended way to go about it?Easypanel
Manage your server without fighting the terminal. Server control panel based on Docker.
4 Replies
I would make a Docker compose that sets everything up.
no, dont wanna do that for 1 script only. im sure its a pretty easy solution. maybe im right about pre-script but have to test & i have another unrelated bug to squash first before i can try it.
after a month, i went with docker (had to learn it) but still face an error. i thought this would solve the problem. do you have any idea why this doesn't work?
https://stackoverflow.com/q/78031427/6141587
i run it like this at the end of dockerfile:
Stack Overflow
Cannot find package 'drizzle-orm' in Docker Container even though I...
I install all my dependencies in Dockerfile using npm ci below.
Dockerfile
FROM node:20-alpine AS base
1. Install dependencies only when needed
FROM base AS deps
Check https://github.com/nodejs/
so i finally figured out the solution although it took a week or so.
pnpm install
in run.sh
takes a minute but it works lol -> https://stackoverflow.com/a/78034626/6141587Stack Overflow
Cannot find package 'drizzle-orm' in Docker Container even though I...
I install all my dependencies in Dockerfile using npm ci below.
Dockerfile
FROM node:20-alpine AS base
1. Install dependencies only when needed
FROM base AS deps
Check https://github.com/nodejs/