switched to fully self contained docker

This commit is contained in:
2026-07-26 14:01:20 -05:00
parent 0ed0fb5817
commit 5d2f90ce24
34 changed files with 688 additions and 672 deletions
+6 -4
View File
@@ -17,7 +17,7 @@ import (
"strings"
"time"
_ "github.com/go-sql-driver/mysql"
_ "modernc.org/sqlite"
)
//go:embed templates/*.html static/*
@@ -110,13 +110,15 @@ type pageData struct {
}
func New(cfg Config) (*Server, error) {
db, err := sql.Open("mysql", cfg.DatabaseDSN)
db, err := sql.Open("sqlite", cfg.DatabaseDSN)
if err != nil {
return nil, err
}
db.SetConnMaxLifetime(5 * time.Minute)
db.SetMaxOpenConns(20)
db.SetMaxIdleConns(10)
// A single writer connection avoids SQLITE_BUSY errors while WAL mode still
// permits concurrent readers. This service is intentionally single-node.
db.SetMaxOpenConns(1)
db.SetMaxIdleConns(1)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()