Spaces:
Running
Running
Commit ·
99c9c71
1
Parent(s): 8816fff
fix(hf-spaces): use nest start (ts-node) instead of nest build to avoid webpack
Browse filesnest-cli.json forces webpack:true but webpack isn't installed as a dep.
Skip the build step entirely — use `npx nest start api` at runtime which
uses ts-node for JIT compilation (no webpack needed). Bumped health-check
timeout from 120s to 180s to accommodate ts-node first-compile time.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Dockerfile +3 -3
- start.sh +6 -6
Dockerfile
CHANGED
|
@@ -30,12 +30,12 @@ RUN pip install --no-cache-dir --upgrade pip \
|
|
| 30 |
# Install Playwright Chromium browser
|
| 31 |
RUN playwright install chromium
|
| 32 |
|
| 33 |
-
# Clone ever-jobs
|
| 34 |
# vendor/ is in .dockerignore so it never comes from the build context
|
|
|
|
| 35 |
RUN git clone https://github.com/ever-jobs/ever-jobs.git vendor/ever-jobs --depth=1 \
|
| 36 |
&& cd vendor/ever-jobs \
|
| 37 |
-
&& npm install --legacy-peer-deps
|
| 38 |
-
&& npx nest build api
|
| 39 |
|
| 40 |
# Copy app code (this layer re-runs on every code change, which is expected)
|
| 41 |
COPY --chown=user . .
|
|
|
|
| 30 |
# Install Playwright Chromium browser
|
| 31 |
RUN playwright install chromium
|
| 32 |
|
| 33 |
+
# Clone ever-jobs and install Node deps (separate layer — cached unless repo changes)
|
| 34 |
# vendor/ is in .dockerignore so it never comes from the build context
|
| 35 |
+
# nest-cli.json forces webpack which isn't installed; ts-node (nest start) is used at runtime instead
|
| 36 |
RUN git clone https://github.com/ever-jobs/ever-jobs.git vendor/ever-jobs --depth=1 \
|
| 37 |
&& cd vendor/ever-jobs \
|
| 38 |
+
&& npm install --legacy-peer-deps
|
|
|
|
| 39 |
|
| 40 |
# Copy app code (this layer re-runs on every code change, which is expected)
|
| 41 |
COPY --chown=user . .
|
start.sh
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
-
# Start ever-jobs NestJS API in background, then Streamlit.
|
| 3 |
-
# If ever-jobs fails to start within
|
| 4 |
-
# (
|
| 5 |
|
| 6 |
echo "=== Starting ever-jobs API on port 3001 ==="
|
| 7 |
cd /app/vendor/ever-jobs
|
| 8 |
-
|
| 9 |
EVER_JOBS_PID=$!
|
| 10 |
|
| 11 |
-
echo "Waiting for ever-jobs to be ready (up to
|
| 12 |
READY=0
|
| 13 |
-
for i in $(seq 1
|
| 14 |
if curl -sf http://localhost:3001/health > /dev/null 2>&1; then
|
| 15 |
echo "ever-jobs ready after ${i}x2s"
|
| 16 |
READY=1
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
+
# Start ever-jobs NestJS API in background (ts-node mode, no webpack needed), then Streamlit.
|
| 3 |
+
# If ever-jobs fails to start within 180s, Streamlit still launches
|
| 4 |
+
# (dedicated scrapers for LinkedIn/Indeed/Glassdoor/Remotive/WWR still work; ever-jobs skipped).
|
| 5 |
|
| 6 |
echo "=== Starting ever-jobs API on port 3001 ==="
|
| 7 |
cd /app/vendor/ever-jobs
|
| 8 |
+
npx nest start api &
|
| 9 |
EVER_JOBS_PID=$!
|
| 10 |
|
| 11 |
+
echo "Waiting for ever-jobs to be ready (up to 180s — ts-node compiles on first start)..."
|
| 12 |
READY=0
|
| 13 |
+
for i in $(seq 1 90); do
|
| 14 |
if curl -sf http://localhost:3001/health > /dev/null 2>&1; then
|
| 15 |
echo "ever-jobs ready after ${i}x2s"
|
| 16 |
READY=1
|