File size: 1,348 Bytes
cab7941
4e46113
cab7941
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43e7aaa
cab7941
 
 
43e7aaa
 
 
cab7941
 
 
 
 
 
 
4e46113
 
cab7941
4e46113
 
cab7941
43e7aaa
cab7941
 
4e46113
cab7941
4e46113
 
cab7941
43e7aaa
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 ubuntu:20.04

# Set non-interactive mode for APT
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies
RUN apt-get update && apt-get install -y \
    wget \
    gnupg \
    apt-transport-https \
    ca-certificates \
    software-properties-common \
    --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Add deadsnakes PPA for Python 3.10
RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y \
    python3.10 \
    python3.10-venv \
    python3.10-dev \
    curl \
    --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Remove existing pip and install the latest version
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

# Install Chromium
RUN apt-get update && apt-get install -y \
    chromium-browser \
    --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Create a working directory
WORKDIR /code

# Copy requirements file
COPY ./requirements.txt /code/requirements.txt

# Install Python dependencies
RUN python3.10 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt && \
    python3.10 -m pip install -U g4f[all] && \
    python3.10 -m pip install -U g4f[webdriver]

# Copy the rest of the application code
COPY . .

# Set the command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]