Spaces:
Sleeping
Sleeping
Commit ·
8cca58b
1
Parent(s): 2492439
fix: NODE_ENV=production was silently skipping devDeps during Docker build - move to runtime only, add lightningcss
Browse files- Dockerfile +7 -8
- lifeline-ai/package-lock.json +1 -0
- lifeline-ai/package.json +1 -0
Dockerfile
CHANGED
|
@@ -5,8 +5,7 @@ LABEL maintainer="LifeLine Team" \
|
|
| 5 |
org.opencontainers.image.title="LifeLine AI" \
|
| 6 |
description="Next.js frontend with optional Python FastAPI backend (Hugging Face Spaces ready)"
|
| 7 |
|
| 8 |
-
ENV
|
| 9 |
-
PYTHONUNBUFFERED=1 \
|
| 10 |
DEBIAN_FRONTEND=noninteractive
|
| 11 |
|
| 12 |
# Root workspace
|
|
@@ -24,12 +23,9 @@ COPY . .
|
|
| 24 |
# Move into frontend folder
|
| 25 |
WORKDIR /app/lifeline-ai
|
| 26 |
|
| 27 |
-
# Install
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
else \
|
| 31 |
-
npm install --no-audit --no-fund; \
|
| 32 |
-
fi
|
| 33 |
|
| 34 |
# Build frontend
|
| 35 |
RUN npm run build
|
|
@@ -43,5 +39,8 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 43 |
# Expose HF Space port
|
| 44 |
EXPOSE 7860
|
| 45 |
|
|
|
|
|
|
|
|
|
|
| 46 |
# Run backend + frontend
|
| 47 |
CMD ["sh", "-c", "uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 2>/dev/null & cd /app/lifeline-ai && exec npm run start -- -p 7860"]
|
|
|
|
| 5 |
org.opencontainers.image.title="LifeLine AI" \
|
| 6 |
description="Next.js frontend with optional Python FastAPI backend (Hugging Face Spaces ready)"
|
| 7 |
|
| 8 |
+
ENV PYTHONUNBUFFERED=1 \
|
|
|
|
| 9 |
DEBIAN_FRONTEND=noninteractive
|
| 10 |
|
| 11 |
# Root workspace
|
|
|
|
| 23 |
# Move into frontend folder
|
| 24 |
WORKDIR /app/lifeline-ai
|
| 25 |
|
| 26 |
+
# Install ALL dependencies (including devDependencies needed for build)
|
| 27 |
+
# NODE_ENV is NOT set to production here — that would skip devDeps and break the build
|
| 28 |
+
RUN npm ci --include=dev --no-audit --no-fund
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Build frontend
|
| 31 |
RUN npm run build
|
|
|
|
| 39 |
# Expose HF Space port
|
| 40 |
EXPOSE 7860
|
| 41 |
|
| 42 |
+
# Set production mode at runtime only (not at build time)
|
| 43 |
+
ENV NODE_ENV=production
|
| 44 |
+
|
| 45 |
# Run backend + frontend
|
| 46 |
CMD ["sh", "-c", "uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 2>/dev/null & cd /app/lifeline-ai && exec npm run start -- -p 7860"]
|
lifeline-ai/package-lock.json
CHANGED
|
@@ -22,6 +22,7 @@
|
|
| 22 |
"autoprefixer": "latest",
|
| 23 |
"eslint": "^9",
|
| 24 |
"eslint-config-next": "16.2.2",
|
|
|
|
| 25 |
"postcss": "latest",
|
| 26 |
"tailwindcss": "latest",
|
| 27 |
"typescript": "^5"
|
|
|
|
| 22 |
"autoprefixer": "latest",
|
| 23 |
"eslint": "^9",
|
| 24 |
"eslint-config-next": "16.2.2",
|
| 25 |
+
"lightningcss": "latest",
|
| 26 |
"postcss": "latest",
|
| 27 |
"tailwindcss": "latest",
|
| 28 |
"typescript": "^5"
|
lifeline-ai/package.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
| 25 |
"autoprefixer": "latest",
|
| 26 |
"eslint": "^9",
|
| 27 |
"eslint-config-next": "16.2.2",
|
|
|
|
| 28 |
"postcss": "latest",
|
| 29 |
"tailwindcss": "latest",
|
| 30 |
"typescript": "^5"
|
|
|
|
| 25 |
"autoprefixer": "latest",
|
| 26 |
"eslint": "^9",
|
| 27 |
"eslint-config-next": "16.2.2",
|
| 28 |
+
"lightningcss": "latest",
|
| 29 |
"postcss": "latest",
|
| 30 |
"tailwindcss": "latest",
|
| 31 |
"typescript": "^5"
|