Perspicacious commited on
Commit
9cc9e89
·
1 Parent(s): 39d2ba7

Expose n8n instead of PDF helper

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. pdf-server.js +3 -2
Dockerfile CHANGED
@@ -30,8 +30,11 @@ ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
30
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
31
  ENV N8N_USER_FOLDER=/data/.n8n
32
  ENV N8N_COMMUNITY_PACKAGES_ENABLED=true
 
33
  ENV N8N_PORT=7860
34
  ENV N8N_LISTEN_ADDRESS=0.0.0.0
 
 
35
 
36
  COPY start.sh /start.sh
37
  RUN chmod +x /start.sh
 
30
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
31
  ENV N8N_USER_FOLDER=/data/.n8n
32
  ENV N8N_COMMUNITY_PACKAGES_ENABLED=true
33
+ ENV PORT=7860
34
  ENV N8N_PORT=7860
35
  ENV N8N_LISTEN_ADDRESS=0.0.0.0
36
+ ENV PDF_SERVER_HOST=127.0.0.1
37
+ ENV PDF_SERVER_PORT=3000
38
 
39
  COPY start.sh /start.sh
40
  RUN chmod +x /start.sh
pdf-server.js CHANGED
@@ -6,7 +6,8 @@ const path = require('path');
6
  const app = express();
7
  app.use(express.json({ limit: '50mb' }));
8
 
9
- const PORT = 3000;
 
10
  const CHROMIUM_PATH = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH || '/usr/bin/chromium';
11
 
12
  // Arguments Chromium pour environnement restreint (HuggingFace)
@@ -402,7 +403,7 @@ app.post('/scroll-capture', async (req, res) => {
402
  });
403
 
404
  // ==================== START ====================
405
- app.listen(PORT, '0.0.0.0', () => {
406
  console.log(`🚀 PDF Server v2 running on port ${PORT}`);
407
  console.log(`📄 Endpoints: /health, /generate-pdf, /screenshot, /multi-screenshot, /scrape, /scroll-capture`);
408
  });
 
6
  const app = express();
7
  app.use(express.json({ limit: '50mb' }));
8
 
9
+ const PORT = Number(process.env.PDF_SERVER_PORT || 3000);
10
+ const HOST = process.env.PDF_SERVER_HOST || '127.0.0.1';
11
  const CHROMIUM_PATH = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH || '/usr/bin/chromium';
12
 
13
  // Arguments Chromium pour environnement restreint (HuggingFace)
 
403
  });
404
 
405
  // ==================== START ====================
406
+ app.listen(PORT, HOST, () => {
407
  console.log(`🚀 PDF Server v2 running on port ${PORT}`);
408
  console.log(`📄 Endpoints: /health, /generate-pdf, /screenshot, /multi-screenshot, /scrape, /scroll-capture`);
409
  });