File size: 825 Bytes
979c7a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
FROM python:3.9-slim

WORKDIR /app

# Install build essentials and wget
RUN apt-get update && \
    apt-get install -y build-essential wget git && \
    rm -rf /var/lib/apt/lists/*

# Clone and install fastText v0.9.2 (stable release)
RUN git clone --branch v0.9.2 https://github.com/facebookresearch/fastText.git && \
    cd fastText && \
    pip install .

# Download the language identification model (v1.0)
# Model details: https://fasttext.cc/docs/en/language-identification.html
RUN wget https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy application code
COPY app.py .

# Expose port
EXPOSE 8000

# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]