File size: 1,190 Bytes
5386d70
420a25a
728bbc9
420a25a
9f717a0
dfb6499
 
7da8f0d
 
 
9f717a0
7da8f0d
 
9f717a0
728bbc9
7da8f0d
c708315
9f717a0
eab38f2
728bbc9
420a25a
9f717a0
728bbc9
420a25a
9f717a0
7da8f0d
420a25a
9f717a0
8f8c2f2
 
93166b5
 
7da8f0d
728bbc9
c708315
 
728bbc9
 
 
420a25a
dfb6499
7da8f0d
 
9f717a0
da44b9f
 
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
FROM python:3.11-slim-bullseye

WORKDIR /app

# Enable contrib and non-free repos, and install system dependencies
RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
    unrar \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

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

# Copy app files
COPY main.py .
COPY docker-entrypoint.sh .

# Make entrypoint executable
RUN chmod +x docker-entrypoint.sh

# Create app folders
RUN mkdir -p /app/downloads /app/extracted /app/state

# Create and switch to non-root user
RUN useradd -m -s /bin/bash -u 1000 user && \
    chown -R user:user /app
USER user

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV HF_TOKEN=""
ENV SOURCE_REPO="Fred808/BG1"
ENV DOWNLOAD_FOLDER=/app/downloads
ENV EXTRACT_FOLDER=/app/extracted
ENV STATE_FOLDER=/app/state

# Declare volumes
VOLUME ["/app/extracted", "/app/state"]

# Entrypoint and command
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD bash -c "python main.py && echo '🟡 Script done, container alive...' && tail -f /dev/null"