🐳 Improve dockerfile and start script and fix permission issue #1602

This commit is contained in:
Thomas Camlong
2023-11-12 13:37:01 +01:00
committed by GitHub
6 changed files with 69 additions and 27 deletions

View File

@@ -1,18 +0,0 @@
// This file is used to migrate the database to the current version
// It is run when the docker container starts
import Database from 'better-sqlite3';
import dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/better-sqlite3';
import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
dotenv.config({ path: __dirname + '/../.env' });
const sqlite = new Database(process.env.DATABASE_URL!.replace('file:', ''));
const db = drizzle(sqlite);
const migrateDatabase = async () => {
await migrate(db, { migrationsFolder: './drizzle' });
};
migrateDatabase();