Spaces:
Running
Running
File size: 1,077 Bytes
a0755f8 ad77c79 5838390 a0755f8 23ba989 1036afe 23ba989 1036afe a0755f8 ad77c79 a0755f8 ad77c79 ac29bc1 ad77c79 ac29bc1 a0755f8 ac29bc1 a0755f8 ad77c79 ac29bc1 23ba989 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Stage 1: Build Frontend
FROM node:20 AS build-frontend
WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps
COPY . .
RUN mkdir -p src/components public
# Move EVERYTHING to where Vite expects them
# 1. Main app files and CSS to src/
RUN mv App.jsx App.css main.jsx index.css src/ 2>/dev/null || true
# 2. Components to src/components/
RUN mv ContactForm.jsx Footer.jsx Hero.jsx InteractiveWaves.jsx Navigation.jsx StatsGrid.jsx TextReveal.jsx UseCaseTabs.jsx Workflow.jsx src/components/ 2>/dev/null || true
# 3. Assets to public/
RUN mv vite.svg react.svg hero.png public/ 2>/dev/null || true
RUN npm run build
# Stage 2: Backend
FROM python:3.10-slim
WORKDIR /app
# Simple copy for requirements
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy everything and the frontend build
COPY . .
COPY --from=build-frontend /app/dist /app/dist
ENV PYTHONPATH=/app
ENV PORT=7860
EXPOSE 7860
# Run uvicorn using main.py in the root
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--forwarded-allow-ips", "*"]
|