ishraddhapawar commited on
Commit
ac29bc1
·
verified ·
1 Parent(s): 23ba989

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -3,27 +3,29 @@ FROM node:20 AS build-frontend
3
  WORKDIR /app
4
  COPY package*.json ./
5
  RUN npm install
6
-
7
- # Move your "Flat" files into the exact folder structure the build expects
8
  COPY . .
9
  RUN mkdir -p src/components public
10
- # 1. Move the main app files to src/
11
  RUN mv App.jsx App.css main.jsx src/ 2>/dev/null || true
12
- # 2. Move the components to src/components/
13
  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
14
- # 3. Move assets to public/
15
  RUN mv vite.svg react.svg hero.png public/ 2>/dev/null || true
16
-
17
  RUN npm run build
18
 
19
  # Stage 2: Backend
20
  FROM python:3.10-slim
21
  WORKDIR /app
22
- COPY server/requirements.txt ./ 2>/dev/null || COPY requirements.txt ./
 
 
23
  RUN pip install --no-cache-dir -r requirements.txt
 
 
24
  COPY . .
 
 
25
  ENV PYTHONPATH=/app
26
  ENV PORT=7860
27
- COPY --from=build-frontend /app/dist /app/dist
28
  EXPOSE 7860
 
 
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--forwarded-allow-ips", "*"]
 
3
  WORKDIR /app
4
  COPY package*.json ./
5
  RUN npm install
 
 
6
  COPY . .
7
  RUN mkdir -p src/components public
8
+ # Move files to where Vite expects them
9
  RUN mv App.jsx App.css main.jsx src/ 2>/dev/null || true
 
10
  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
 
11
  RUN mv vite.svg react.svg hero.png public/ 2>/dev/null || true
 
12
  RUN npm run build
13
 
14
  # Stage 2: Backend
15
  FROM python:3.10-slim
16
  WORKDIR /app
17
+
18
+ # Simple copy for requirements
19
+ COPY requirements.txt ./
20
  RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Copy everything and the frontend build
23
  COPY . .
24
+ COPY --from=build-frontend /app/dist /app/dist
25
+
26
  ENV PYTHONPATH=/app
27
  ENV PORT=7860
 
28
  EXPOSE 7860
29
+
30
+ # Run uvicorn using main.py in the root
31
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--forwarded-allow-ips", "*"]