File size: 1,552 Bytes
c5bf90f
 
 
 
5638f9d
f8de77d
0e01c28
f8de77d
5638f9d
c5bf90f
 
5638f9d
 
 
 
 
 
 
c5bf90f
5638f9d
c5bf90f
 
5638f9d
 
 
 
c5bf90f
 
22e5514
5638f9d
 
 
 
 
48e30fb
5638f9d
48e30fb
5638f9d
 
48e30fb
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
32
33
34
35
36
37
38
39
40
41
FROM docker.io/library/python:3.10@sha256:57a1551f66ab235f86bc3c1fc2bc2c5c1632d26171d238b68bd02a67bdb

WORKDIR /home/user/app

# Download NLTK data
RUN python -m nltk.downloader punkt
RUN python -m nltk.downloader stopwords

# Install system packages
RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install

# Setup user
RUN apt-get update && apt-get install -y fakeroot && \
    mv /usr/bin/apt-get /usr/bin/.apt-get && \
    echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
    chmod +x /usr/bin/apt-get && \
    rm -rf /var/lib/apt/lists/* && \
    useradd -m -u 1000 user

# Copy everything from the root directory
COPY --chown=1000:1000 --from=root / /

# Install packages from packages.txt
RUN --mount=target=/tmp/packages.txt,source=packages.txt apt-get update && \
    xargs -r -a /tmp/packages.txt apt-get install -y && \
    rm -rf /var/lib/apt/lists/*

# Copy the model file
COPY frontend/FINAL_MODEL.keras /home/user/app/ 

# Install Rust and Cargo (if needed for orjson)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/user/.cargo/bin:${PATH}"

# Install Python dependencies - Specifying tensorflow version
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt tensorflow==2.12

# Install Streamlit, uvicorn, and spaces (for Hugging Face Spaces)
RUN pip install --no-cache-dir streamlit==1.37.1 "uvicorn>=0.14.0" spaces