File size: 1,376 Bytes
cb71789
 
bad257a
cb71789
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bad257a
8956ebe
 
 
 
 
bad257a
c3d87c4
8956ebe
 
 
c3d87c4
2e89e13
 
 
 
 
 
cb71789
bad257a
2e89e13
cb71789
9152e9a
cb71789
bad257a
cb71789
 
c3d87c4
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
# Use the official Python image as the base image
FROM python:3.10-slim

# Install dependencies for Selenium and Chrome
RUN apt-get update && apt-get install -y \
    wget \
    unzip \
    curl \
    gnupg \
    libnss3 \
    libgconf-2-4 \
    libxi6 \
    libxcursor1 \
    libxrandr2 \
    libxss1 \
    libxtst6 \
    fonts-liberation \
    xdg-utils \
    libatk-bridge2.0-0 \
    libgtk-3-0 \
    --no-install-recommends && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y wget unzip && \
    wget https://dl.google.com/Linux/direct/google-chrome-stable_current_amd64.deb && \
    apt install -y ./google-chrome-stable_current_amd64.deb && \
    rm google-chrome-stable_current_amd64.deb && \
    apt-get clean

# # Update the package list and install wget, unzip, and Firefox
# RUN apt-get update && apt-get install -y wget unzip \
#     && apt-get install -y firefox-esr \
#     && apt-get clean
RUN which google-chrome
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app
# WORKDIR /app

COPY --chown=user . $HOME/app
# COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
# Install Python dependencies

# Run the Selenium script
# CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]