File size: 1,040 Bytes
2589745
cb81069
2589745
 
 
 
 
 
 
 
 
 
cb81069
2589745
 
 
 
 
 
 
ab71c0c
 
 
 
2589745
 
 
 
 
 
 
 
 
 
 
a804a64
 
2589745
 
 
 
bb660e1
 
 
 
2589745
 
 
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
42
43
44
45
46
47
48
49
# Stage 1: Build stage (installs docker)
FROM python:3.10.12 AS builder

RUN apt-get update && apt-get install -y \
    docker-ce \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Clear build cache
RUN docker builder prune -f

# Stage 2: Final stage
FROM python:3.10.12

USER root
RUN apt-get update && \
    apt-get install -y \
    libgl1-mesa-glx \
    ffmpeg \
    git \
    git-lfs \
    && git lfs install && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    NUMBA_CACHE_DIR=/tmp/numba_cache

WORKDIR $HOME/app

COPY --chown=user . $HOME/app

RUN chmod +x scripts/download_models.sh
RUN bash scripts/download_models.sh

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

RUN ls -la

# Install the current package with verbose output
RUN pip install . --verbose

# Set the command to run the application
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "app_hallo:app"]