-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bak
More file actions
41 lines (31 loc) · 1000 Bytes
/
Dockerfile.bak
File metadata and controls
41 lines (31 loc) · 1000 Bytes
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
36
37
38
39
40
41
FROM python:3.12-slim
WORKDIR /workspace
# Set environment variables
ENV APP_NAME=rag_chat_api
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libmagic1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories with proper permissions
RUN mkdir -p db/chroma && \
chmod -R 755 db
# IMPORTANT: Copy and install requirements first
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy pre-built ChromaDB (if it exists locally)
COPY db/chroma /workspace/db/chroma
# Copy configuration files
COPY .env.prod ./.env.prod
COPY docker-entrypoint.sh ./
RUN chmod +x ./docker-entrypoint.sh
# Copy source code
COPY embeddings.py api.py ./
# Expose the API port
EXPOSE 8000
# Command to run the application
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]