Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.11-slim
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
# Install system dependencies
|
6 |
+
RUN apt-get update && apt-get install -y \
|
7 |
+
build-essential \
|
8 |
+
curl \
|
9 |
+
libcurl4-openssl-dev \
|
10 |
+
libssl-dev \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Copy requirements first to leverage Docker cache
|
14 |
+
COPY requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Copy the rest of the application
|
18 |
+
COPY . .
|
19 |
+
|
20 |
+
# Expose the port the app runs on
|
21 |
+
EXPOSE 9000
|
22 |
+
|
23 |
+
# Environment variables with defaults
|
24 |
+
ENV OPENAI_API_KEY=None
|
25 |
+
ENV ENVIRONMENT="production"
|
26 |
+
|
27 |
+
# Command to run the application
|
28 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "9000"]
|