summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile1
-rw-r--r--app/lib/db.server.ts2
2 files changed, 2 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
index 45c4813..a8e0833 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,6 +20,7 @@ RUN --mount=type=cache,target=/root/.npm \
FROM node:20-alpine AS app
WORKDIR /app
+COPY package.json ./
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/build ./build
RUN mkdir -p /app/data
diff --git a/app/lib/db.server.ts b/app/lib/db.server.ts
index f1cacbb..dd9184d 100644
--- a/app/lib/db.server.ts
+++ b/app/lib/db.server.ts
@@ -5,7 +5,7 @@ let db: Database.Database | null = null;
export function getDb(): Database.Database {
if (!db) {
- const dbPath = path.resolve("whois.db");
+ const dbPath = process.env.DB_PATH ?? path.resolve("whois.db");
db = new Database(dbPath);
db.pragma("journal_mode = WAL");
db.pragma("foreign_keys = ON");