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);
|
||||
|
||||
@@ -7,12 +7,14 @@ version: "3.9"
|
||||
services:
|
||||
gashboard:
|
||||
# Portainer "Stacks → Repository" will build this from the gashboard git repo.
|
||||
# If you want to pull a pre-built image instead, comment out `build:` and
|
||||
# set `image:` to your registry tag.
|
||||
# Do not set `image: gashboard:...` here: Portainer will try to pull that
|
||||
# local-only name from Docker Hub before building and deployment will fail.
|
||||
# If you want to pull a pre-built image instead, replace `build:` with an
|
||||
# `image:` value that includes your registry, for example:
|
||||
# image: ghcr.io/your-user/gashboard:0.1.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: gashboard:0.1.0
|
||||
container_name: gashboard
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user