alaselababatunde commited on
Commit
cede57b
·
1 Parent(s): e58ef37
Files changed (2) hide show
  1. Dockerfile +10 -8
  2. frontend/package.json +1 -1
Dockerfile CHANGED
@@ -3,8 +3,10 @@ FROM node:20-slim as build-frontend
3
 
4
  WORKDIR /app/frontend
5
  COPY frontend/package*.json ./
6
- RUN npm install
 
7
  COPY frontend/ ./
 
8
  RUN npm run build
9
 
10
  # Final stage
@@ -12,7 +14,8 @@ FROM python:3.11-slim
12
 
13
  WORKDIR /app
14
 
15
- # Install system dependencies for ChromaDB and other libraries
 
16
  RUN apt-get update && apt-get install -y \
17
  build-essential \
18
  curl \
@@ -28,12 +31,11 @@ COPY . .
28
  # Copy built frontend from stage 1
29
  COPY --from=build-frontend /app/frontend/dist ./frontend/dist
30
 
31
- # Expose port (user requested 7860)
32
  EXPOSE 7860
33
 
34
- # Command to run the application
35
- # We use uvicorn to serve the FastAPI app which also serves the frontend
36
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
37
-
38
 
39
- # reload trigger
 
 
3
 
4
  WORKDIR /app/frontend
5
  COPY frontend/package*.json ./
6
+ # Use ci for faster, more reliable builds in CI/Docker
7
+ RUN npm ci
8
  COPY frontend/ ./
9
+ # Run build, ensuring we see errors if they occur
10
  RUN npm run build
11
 
12
  # Final stage
 
14
 
15
  WORKDIR /app
16
 
17
+ # Install system dependencies
18
+ # Combine into one layer and cleanup to keep image small
19
  RUN apt-get update && apt-get install -y \
20
  build-essential \
21
  curl \
 
31
  # Copy built frontend from stage 1
32
  COPY --from=build-frontend /app/frontend/dist ./frontend/dist
33
 
34
+ # Expose port
35
  EXPOSE 7860
36
 
37
+ # Set environment variables
38
+ ENV PYTHONUNBUFFERED=1
 
 
39
 
40
+ # Command to run the application
41
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
frontend/package.json CHANGED
@@ -5,7 +5,7 @@
5
  "type": "module",
6
  "scripts": {
7
  "dev": "vite",
8
- "build": "tsc -b && vite build",
9
  "lint": "eslint .",
10
  "preview": "vite preview"
11
  },
 
5
  "type": "module",
6
  "scripts": {
7
  "dev": "vite",
8
+ "build": "vite build",
9
  "lint": "eslint .",
10
  "preview": "vite preview"
11
  },