-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 780 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
# Use an official lightweight Python image
FROM python:3.13
# Set the working directory inside the container
WORKDIR /app
# Prevent Python from generating .pyc files and buffering stdout
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends gcc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy requirements and install dependencies
COPY requirements .
RUN pip install --no-cache-dir -r requirements
# Copy your python code (main.py, model.py, etc.)
COPY . .
# Create the data directory explicitly
RUN mkdir -p /app/data
# Expose the port FastAPI runs on
EXPOSE 8000
# Command to run the app
CMD ["uvicorn", "pdf_api:app", "--host", "0.0.0.0", "--port", "8000"]