adding dev mode

This commit is contained in:
2026-05-04 18:21:52 +02:00
parent 58627cbfd1
commit f5b56cad91
4 changed files with 10 additions and 3 deletions

View File

@@ -42,4 +42,11 @@ now vist http://localhost:1337 in your browser
## dev
tbd
`docker compose up -d f0ckm-db`
on dev machine:
`npm i`
`npm run dev`
now visit http://localhost:1337 in your browser, you can develop without needing to rebuild the docker image for every change

View File

@@ -31,7 +31,6 @@ services:
- ./f0ckm-data/hall_custom/:/opt/f0bm/public/hall_custom/:Z
- ./f0ckm-data/manifest.json:/opt/f0bm/public/manifest.json:Z
command: npm run start
environment:
- GIT_HASH=${f0ckm_TAG:-unknown}
ports:

View File

@@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"start": "node --trace-uncaught src/index.mjs",
"dev": "node --trace-uncaught --watch src/index.mjs",
"dev": "STORAGE_DIR=f0ckm-data DB_HOST=localhost DB_PORT=5454 node --trace-uncaught --watch src/index.mjs",
"trigger": "node debug/trigger.mjs",
"autotagger": "node debug/autotagger.mjs",
"thumbnailer": "node debug/thumbnailer.mjs",

View File

@@ -7,6 +7,7 @@ let config = JSON.parse(JSON.stringify(_config));
// Environment variable overrides for database connection
if (process.env.DB_HOST) config.sql.host = process.env.DB_HOST;
if (process.env.DB_PORT) config.sql.port = parseInt(process.env.DB_PORT, 10);
if (process.env.DB_USER) config.sql.user = process.env.DB_USER;
if (process.env.DB_PASS) config.sql.password = process.env.DB_PASS;
if (process.env.DB_NAME) config.sql.database = process.env.DB_NAME;