diff --git a/.gitignore b/.gitignore index 59e2d64..63cfae0 100644 --- a/.gitignore +++ b/.gitignore @@ -175,4 +175,4 @@ dist .DS_Store dist -db/users.db +data diff --git a/Dockerfile b/Dockerfile index f08ba42..360de37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production FROM base AS release COPY --from=build /temp/prod/. . RUN chown -R bun:bun . +RUN mkdir data && chown -R bun:bun data # run the app USER bun diff --git a/db/index.ts b/db/index.ts index 59382a1..eda2a5f 100644 --- a/db/index.ts +++ b/db/index.ts @@ -3,7 +3,7 @@ import { Database } from "bun:sqlite"; import { migrate } from "drizzle-orm/bun-sqlite/migrator"; -const sqlite = new Database("db/users.db"); +const sqlite = new Database("data/users.db"); const db = drizzle(sqlite); await migrate(db, { migrationsFolder: "./drizzle" }); export { db }; \ No newline at end of file diff --git a/db/migrate.ts b/db/migrate.ts index 9e143e5..c297dc8 100644 --- a/db/migrate.ts +++ b/db/migrate.ts @@ -3,6 +3,6 @@ import { migrate } from "drizzle-orm/bun-sqlite/migrator"; import { drizzle } from "drizzle-orm/bun-sqlite"; import { Database } from "bun:sqlite"; -const sqlite = new Database("db/users.db"); +const sqlite = new Database("data/users.db"); const db = drizzle(sqlite); await migrate(db, { migrationsFolder: "./drizzle", migrationsSchema: "./db/schema.ts", migrationsTable: "users" }); \ No newline at end of file