File size: 1,333 Bytes
41554ec
 
 
 
326bdf8
41554ec
 
 
 
 
db69386
 
41554ec
326bdf8
 
41554ec
 
 
2a778c9
326bdf8
 
 
 
0afa515
a999552
db69386
 
 
a999552
 
326bdf8
41554ec
 
 
5dfcb2d
 
326bdf8
6f9a0fc
5dfcb2d
 
 
 
 
 
 
326bdf8
5dfcb2d
 
326bdf8
5dfcb2d
 
 
 
41554ec
a999552
 
 
5dfcb2d
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
50
51
52
53
54
55
56
57
58
FROM python:3.9-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libglib2.0-dev \
    libssl-dev \
    libcurl4-openssl-dev \
    meson \
    ninja-build \
    git \
    curl \
    sqlite3 \
    --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
    apt-get install -y nodejs

# Clone and build megatools
RUN git clone https://xff.cz/git/megatools && \
    cd megatools && \
    meson setup build && \
    ninja -C build && \
    ninja -C build install && \
    cd .. && rm -rf megatools

# Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy frontend files and build
COPY frontend/package*.json ./frontend/
WORKDIR /app/frontend
RUN npm install --omit=dev
COPY frontend/public ./public
COPY frontend/src ./src
RUN npm run build && \
    # Remove node_modules after build to save space
    rm -rf node_modules

# Copy backend files
WORKDIR /app
COPY *.py ./
COPY providers ./providers/

# Create HF user and set permissions efficiently
RUN useradd -m -u 1000 user && \
    mkdir -p /tmp/vod-archiver && \
    chown -R 1000:1000 /app /tmp/vod-archiver

USER user

EXPOSE 7860
CMD ["python", "app.py"]