Spaces:
Sleeping
Sleeping
Commit
·
a17bbc5
1
Parent(s):
249a397
Modified dockerfile
Browse files- .gitignore +1 -1
- Dockerfile +7 -1
.gitignore
CHANGED
|
@@ -2,7 +2,7 @@ __pycache__/
|
|
| 2 |
*.pyc
|
| 3 |
node_modules/
|
| 4 |
ui/node_modules/
|
| 5 |
-
|
| 6 |
.DS_Store
|
| 7 |
*.log
|
| 8 |
.env
|
|
|
|
| 2 |
*.pyc
|
| 3 |
node_modules/
|
| 4 |
ui/node_modules/
|
| 5 |
+
|
| 6 |
.DS_Store
|
| 7 |
*.log
|
| 8 |
.env
|
Dockerfile
CHANGED
|
@@ -2,13 +2,19 @@
|
|
| 2 |
FROM node:20-alpine AS ui-builder
|
| 3 |
WORKDIR /app/ui
|
| 4 |
|
| 5 |
-
#
|
| 6 |
COPY ui/package*.json ./
|
| 7 |
RUN npm ci
|
| 8 |
|
|
|
|
| 9 |
COPY ui/ ./
|
| 10 |
RUN npm run build
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# ---------- Python runtime ----------
|
| 13 |
FROM python:3.11-slim
|
| 14 |
|
|
|
|
| 2 |
FROM node:20-alpine AS ui-builder
|
| 3 |
WORKDIR /app/ui
|
| 4 |
|
| 5 |
+
# install deps
|
| 6 |
COPY ui/package*.json ./
|
| 7 |
RUN npm ci
|
| 8 |
|
| 9 |
+
# build
|
| 10 |
COPY ui/ ./
|
| 11 |
RUN npm run build
|
| 12 |
|
| 13 |
+
# normalize to /app/ui/out regardless of framework (Vite=dist, CRA=build)
|
| 14 |
+
RUN if [ -d dist ]; then mv dist out; \
|
| 15 |
+
elif [ -d build ]; then mv build out; \
|
| 16 |
+
else echo "No UI build output found" && ls -la && exit 1; fi
|
| 17 |
+
|
| 18 |
# ---------- Python runtime ----------
|
| 19 |
FROM python:3.11-slim
|
| 20 |
|