add example docker-compose, fix db location

AuthorKonata <konata@posteo.jp>
Date
Commitc6b5de49f8ffe6eea5396d99cba80501810edc51
Parentde611b1
4 files changed, 12 insertions(+), 6 deletions(-)
M.dockerignore
@@ -40,5 +40,5 @@ yarn-error.log*
4040 **/*.log
4141 package-lock.json
4242 **/*.bun
43-*.sqlite
43+db
4444 assets/dist
M.gitignore
@@ -40,5 +40,5 @@ yarn-error.log*
4040 **/*.log
4141 package-lock.json
4242 **/*.bun
43-*.sqlite
43+db
4444 assets/dist
Adocker-compose.yml
@@ -0,0 +1,9 @@
1+services:
2+ zigbin:
3+ build:
4+ context: .
5+ dockerfile: Dockerfile
6+ volumes:
7+ - ./db:/app/db
8+ ports:
9+ - 3000:3000
Msrc/index.ts
@@ -7,10 +7,7 @@ import crypto from 'crypto'
77 import { DecryptFile, filetypes, Index, NotFound, SetCookie, ShowFile, WrongPassword } from "./components"
88 import cron from "@elysiajs/cron"
99
10-
11-//TODO: add deletion timer
12-
13-const db = new Database("./db.sqlite")
10+const db = new Database("./db/db.sqlite")
1411 db.exec("PRAGMA foreign_keys = ON")
1512 db.exec("PRAGMA journal_mode = WAL2")
1613 db.exec("CREATE TABLE IF NOT EXISTS files (uuid TEXT PRIMARY KEY, filename TEXT NOT NULL, content BLOB NOT NULL, filetype TEXT NOT NULL, encrypted INTEGER NOT NULL, delete_at INTEGER) STRICT")