fix(docker): make Portainer repository deploy buildable
This commit is contained in:
@@ -53,12 +53,15 @@ export function buildApp() {
|
||||
: resolveDefaultStaticDir();
|
||||
|
||||
if (staticDir && fs.existsSync(staticDir)) {
|
||||
logger.info({ staticDir }, "serving web assets");
|
||||
app.use(express.static(staticDir, { index: false, maxAge: "1h" }));
|
||||
app.get(/.*/, (_req, res, next) => {
|
||||
const indexFile = path.join(staticDir, "index.html");
|
||||
if (!fs.existsSync(indexFile)) return next();
|
||||
res.sendFile(indexFile);
|
||||
});
|
||||
} else {
|
||||
logger.warn({ staticDir }, "web assets directory not found");
|
||||
}
|
||||
|
||||
app.use(errorHandler);
|
||||
|
||||
Reference in New Issue
Block a user