File size: 923 Bytes
84b66f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cd0fa8b
 
84b66f0
 
 
 
 
 
 
 
 
 
 
 
 
cd0fa8b
 
c179877
 
84b66f0
cd0fa8b
 
84b66f0
c179877
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
FROM python:3.8-slim-buster

# Install dependencies
RUN apt-get update && apt-get install -y \
    chromium \
    chromium-driver \
    libglib2.0-0 \
    libnss3 \
    libx11-6 \
    libx11-xcb1 \
    libxcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxi6 \
    libxrandr2 \
    libxrender1 \
    libxss1 \
    libxtst6 \
    xdg-utils \
    pandoc \
    fonts-noto-cjk \
    && rm -rf /var/lib/apt/lists/*

RUN groupadd -r myuser && useradd -r -g myuser myuser

# Set environment variables
ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROME_PATH=/usr/lib/chromium/

WORKDIR /app

# Copy requirements and install them
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

# Copy the application code
COPY . .

RUN chown -R myuser:myuser /app

# Expose port 7860
EXPOSE 7860

USER myuser

# Run the application
CMD ["python3", "app.py", "--host", "0.0.0.0", "--port", "7860"]