Update Dockerfile
Browse files- Dockerfile +40 -0
Dockerfile
CHANGED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use Python 3.10 slim image as base
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Set environment variables
|
8 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
9 |
+
PYTHONUNBUFFERED=1 \
|
10 |
+
PYTHONPATH=/app
|
11 |
+
|
12 |
+
# Install system dependencies
|
13 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
14 |
+
build-essential \
|
15 |
+
libffi-dev \
|
16 |
+
&& apt-get clean \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
+
|
19 |
+
# Install Python dependencies
|
20 |
+
COPY requirements.txt .
|
21 |
+
RUN pip install -U pip
|
22 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
+
|
24 |
+
# Copy application code
|
25 |
+
COPY app.py .
|
26 |
+
# COPY openrouter_llm.py .
|
27 |
+
# COPY .env.free .env
|
28 |
+
|
29 |
+
# Create necessary directories
|
30 |
+
RUN mkdir -p uploads vectordb
|
31 |
+
|
32 |
+
# Expose port
|
33 |
+
EXPOSE 8000
|
34 |
+
|
35 |
+
# Set healthcheck
|
36 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
37 |
+
CMD curl -f http://localhost:8000/health || exit 1
|
38 |
+
|
39 |
+
# Command to run the application
|
40 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|