docker deploy setup

This commit is contained in:
Nystik
2026-03-10 21:07:19 +01:00
parent d8d12054b7
commit 21952f8130
5 changed files with 125 additions and 14 deletions

View File

@@ -1,7 +1,9 @@
const path = require('path');
const path = require("path");
module.exports = {
port: process.env.PORT || 8080,
vaultPath: process.env.VAULT_PATH || path.join(__dirname, '..', 'test-vault'),
obsidianAssetsPath: path.join(__dirname, '..', 'investigation', 'obsidian.asar.unpacked'),
vaultPath: process.env.VAULT_PATH || path.join(__dirname, "..", "test-vault"),
obsidianAssetsPath:
process.env.OBSIDIAN_ASSETS_PATH ||
path.join(__dirname, "..", "investigation", "obsidian.asar.unpacked"),
};

View File

@@ -40,18 +40,11 @@ app.use("/api/vault", vaultRoutes);
app.use("/vault-files", express.static(config.vaultPath));
// --- Static serving ---
// Serve the built shim-loader.js
app.use(
"/shim-loader.js",
express.static(path.join(__dirname, "..", "dist", "shim-loader.js")),
);
// dist/ has shim-loader.js + patched index.html (dev mode).
// In Docker, these live inside the obsidian assets dir instead.
app.use(express.static(path.join(__dirname, "..", "dist")));
// Serve patched index.html at root
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "..", "dist", "index.html"));
});
// Serve obsidian assets
// Serve obsidian assets (app.js, app.css, libs, fonts, etc.)
app.use(express.static(config.obsidianAssetsPath));
// --- Start ---