This commit is contained in:
2026-01-11 00:22:34 +00:00
parent c0fb8d611b
commit e1f1367e83
2 changed files with 21 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
const Database = require('better-sqlite3');
const db = new Database('counter.db', { verbose: console.log });
const path = require('path');
// Use DB_PATH env var or default to counter.db
const dbPath = process.env.DB_PATH || 'counter.db';
const db = new Database(dbPath, { verbose: console.log });
// Initialize database
function init() {

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
volumes:
- counter_data:/app/data
environment:
- DB_PATH=/app/data/counter.db
- PORT=3000
restart: unless-stopped
volumes:
counter_data: