openenv / Dockerfile
ishraddhapawar's picture
Update Dockerfile
1036afe verified
Raw History Blame Contribute Delete
1.08 kB
# 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", "*"]