Nexchan commited on
Commit
cab7941
1 Parent(s): 741dd0f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -5
Dockerfile CHANGED
@@ -1,13 +1,47 @@
1
- FROM python:3.10.9
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /code
4
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
- RUN pip install -U g4f[all]
9
- RUN pip install -U g4f[webdriver]
 
 
10
 
 
11
  COPY . .
12
 
13
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM ubuntu:20.04
2
 
3
+ # Set non-interactive mode for APT
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # Install necessary dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ wget \
9
+ gnupg \
10
+ apt-transport-https \
11
+ ca-certificates \
12
+ software-properties-common \
13
+ --no-install-recommends && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ # Add deadsnakes PPA for Python 3.10
17
+ RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y \
18
+ python3.10 \
19
+ python3.10-venv \
20
+ python3.10-dev \
21
+ python3-pip \
22
+ --no-install-recommends && \
23
+ rm -rf /var/lib/apt/lists/*
24
+
25
+ # Install Chromium
26
+ RUN apt-get update && apt-get install -y \
27
+ chromium-browser \
28
+ --no-install-recommends && \
29
+ rm -rf /var/lib/apt/lists/*
30
+
31
+ # Create a working directory
32
  WORKDIR /code
33
 
34
+ # Copy requirements file
35
  COPY ./requirements.txt /code/requirements.txt
36
 
37
+ # Install Python dependencies
38
+ RUN python3.10 -m pip install --no-cache-dir --upgrade pip && \
39
+ python3.10 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt && \
40
+ python3.10 -m pip install -U g4f[all] && \
41
+ python3.10 -m pip install -U g4f[webdriver]
42
 
43
+ # Copy the rest of the application code
44
  COPY . .
45
 
46
+ # Set the command to run the application
47
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]