sepidnes commited on
Commit
c9f9088
·
1 Parent(s): 56fda74

Add RAG implement D

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -21
Dockerfile CHANGED
@@ -1,31 +1,39 @@
 
1
 
2
- # Get a distribution that has uv already installed
3
- FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
 
 
 
 
 
4
 
5
- # Add user - this is the user that will run the app
6
- # If you do not set user, the app will run as root (undesirable)
7
- RUN useradd -m -u 1000 user
8
- USER user
9
 
10
- # Set the home directory and path
11
- ENV HOME=/home/user \
12
- PATH=/home/user/.local/bin:$PATH
13
 
14
- ENV UVICORN_WS_PROTOCOL=websockets
 
 
15
 
 
 
16
 
17
- # Set the working directory
18
- WORKDIR $HOME/app
 
 
19
 
20
- # Copy the app to the container
21
- COPY --chown=user . $HOME/app
 
22
 
23
- # Install the dependencies
24
- # RUN uv sync --frozen
25
- RUN uv sync
26
-
27
- # Expose the port
28
  EXPOSE 7860
29
 
30
- # Run the app
31
- CMD ["uv", "run", "chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM python:3.13-slim
2
 
3
+ # Install Node.js and npm
4
+ RUN apt-get update && apt-get install -y \
5
+ curl \
6
+ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
7
+ && apt-get install -y nodejs \
8
+ && apt-get clean \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Set working directory
12
+ WORKDIR /app
 
 
13
 
14
+ # Copy backend requirements
15
+ COPY backend/requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy backend code
19
+ COPY backend/ ./backend/
20
+ COPY aimakerspace/ ./aimakerspace/
21
 
22
+ # Copy frontend code
23
+ COPY frontend/ ./frontend/
24
 
25
+ # Install frontend dependencies and build
26
+ WORKDIR /app/frontend
27
+ RUN npm install
28
+ RUN npm run build
29
 
30
+ # Set environment variables
31
+ ENV OPENAI_API_KEY=${OPENAI_API_KEY}
32
+ ENV PORT=7860
33
 
34
+ # Expose port
 
 
 
 
35
  EXPOSE 7860
36
 
37
+ # Start both backend and frontend
38
+ WORKDIR /app
39
+ CMD ["sh", "-c", "cd backend && uvicorn main:app --host 0.0.0.0 --port 7860"]