fix: replace broken symlink with REPORTS_DIR env var
The ln -sf /data/reports /app/reports was creating the symlink INSIDE /app/reports/ (since that dir already existed from COPY) instead of replacing it. Result: sitespeed.io wrote to /app/reports/<id> and the parser looked there too, but the volume was at /data/reports. Fix: set REPORTS_DIR=/data/reports in Docker ENV and use it in both runner.js (outputFolder) and app.js (static serving). No symlink needed. Also add .dockerignore to exclude reports/, node_modules/, .git/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
app.js
5
app.js
@@ -27,8 +27,9 @@ app.set('view engine', 'pug');
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.json());
|
||||
|
||||
// Static reports
|
||||
app.use('/reports', express.static(join(__dirname, 'reports')));
|
||||
// Static reports — use REPORTS_DIR env var so Docker and local both work
|
||||
const REPORTS_DIR = process.env.REPORTS_DIR || join(__dirname, 'reports');
|
||||
app.use('/reports', express.static(REPORTS_DIR));
|
||||
|
||||
// Routes
|
||||
app.use('/', indexRouter);
|
||||
|
||||
Reference in New Issue
Block a user