Commit
·
4771a46
1
Parent(s):
038276d
Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as the base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies for TensorFlow and other libraries
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
libhdf5-dev \
|
| 10 |
+
gcc \
|
| 11 |
+
g++ \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Copy requirements file
|
| 15 |
+
COPY requirements.txt .
|
| 16 |
+
|
| 17 |
+
# Install Python dependencies
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
+
|
| 20 |
+
# Copy application code and model files
|
| 21 |
+
COPY main.py .
|
| 22 |
+
COPY model.h5 .
|
| 23 |
+
COPY tokenizer.pkl .
|
| 24 |
+
COPY le_category.pkl .
|
| 25 |
+
COPY le_subcategory.pkl .
|
| 26 |
+
COPY ppo_finetuned_model.zip . # Optional; comment out if not using RL
|
| 27 |
+
|
| 28 |
+
# Expose the port FastAPI will run on
|
| 29 |
+
EXPOSE 8000
|
| 30 |
+
|
| 31 |
+
# Command to run the FastAPI app with uvicorn
|
| 32 |
+
CMD ["uvicorn", "app.py:app", "--host", "0.0.0.0", "--port", "8000"]
|