File size: 863 Bytes
e1581e4
 
c7b1ae2
e1581e4
 
 
 
 
c7b1ae2
 
e1581e4
 
 
 
 
00a7e34
933a887
e1581e4
 
849a7bc
3721a6d
e1581e4
00a7e34
 
e1581e4
 
3721a6d
e1581e4
 
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
# Use the official Python 3.10 slim image
FROM python:3.10-slim

# Set environment variables to prevent Python from writing pyc files and to buffer stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set the working directory to /app
WORKDIR /app

# Install system dependencies (if any)
# For example, if you need gcc for some packages, uncomment the following line
# RUN apt-get update && apt-get install -y gcc

# Copy only the requirements.txt first to leverage Docker cache
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Expose port 8001 to the outside world
EXPOSE 8001

# Command to run the FastAPI app with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]