fix docker stuff

This commit is contained in:
2025-05-10 19:43:13 +01:00
parent f5fe3ff2ce
commit 2b7d8fe691
3 changed files with 23 additions and 7 deletions

View File

@@ -417,6 +417,12 @@ func handleHTTPRequest(state *state) http.HandlerFunc {
}
func initDB() (*sql.DB, error) {
f, err := os.OpenFile("data/data.sqlite", os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
}
f.Close()
db, err := sql.Open("sqlite", "file:data/data.sqlite")
if err != nil {
log.Fatalln("failed to initialize database")