add dockerfile to classifier
Browse files- classifier/Dockerfile +25 -0
classifier/Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 1) Base image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# 2) Print logs unbuffered
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
+
|
7 |
+
# 3) Working directory
|
8 |
+
WORKDIR /app
|
9 |
+
|
10 |
+
# 4) Copy & install Python dependencies
|
11 |
+
COPY requirements.txt ./
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
# 5) Copy your FastAPI app
|
15 |
+
COPY classifier.py .
|
16 |
+
|
17 |
+
# 6) Build-time secret (or omit and inject at runtime)
|
18 |
+
ARG TOGETHERAI_API_KEY
|
19 |
+
ENV TOGETHERAI_API_KEY=${TOGETHERAI_API_KEY}
|
20 |
+
|
21 |
+
# 7) Expose the port
|
22 |
+
EXPOSE 8000
|
23 |
+
|
24 |
+
# 8) Launch Uvicorn directly—no wrapper script needed
|
25 |
+
CMD ["uvicorn", "classifier:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]
|