Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +37 -13
Dockerfile
CHANGED
@@ -1,28 +1,52 @@
|
|
1 |
-
# Use the official Python 3.10.9 image
|
2 |
FROM python:3.10.9
|
3 |
|
4 |
-
# Install
|
|
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
-
# Set the working directory
|
10 |
WORKDIR /app
|
11 |
|
12 |
-
#
|
13 |
-
RUN mkdir /app/temp && chmod 777 /app/temp
|
14 |
-
|
15 |
COPY requirements.txt .
|
16 |
|
17 |
-
# Install
|
18 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
19 |
-
# Copy the current directory contents into the container
|
20 |
|
|
|
|
|
|
|
|
|
21 |
COPY . .
|
22 |
|
|
|
|
|
23 |
|
24 |
-
#
|
25 |
-
|
26 |
|
27 |
-
#
|
28 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
1 |
+
# Use the official Python 3.10.9 image as the base
|
2 |
FROM python:3.10.9
|
3 |
|
4 |
+
# Install system dependencies
|
5 |
+
# These are required for various Python packages and functionalities
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
+
libwoff1 \
|
8 |
+
libopus0 \
|
9 |
+
libwebp6 \
|
10 |
+
libwebpdemux2 \
|
11 |
+
libenchant1c2a \
|
12 |
+
libgudev-1.0-0 \
|
13 |
+
libsecret-1-0 \
|
14 |
+
libhyphen0 \
|
15 |
+
libgdk-pixbuf2.0-0 \
|
16 |
+
libegl1 \
|
17 |
+
libnotify4 \
|
18 |
+
libxslt1.1 \
|
19 |
+
libevent-2.1-7 \
|
20 |
+
libgles2 \
|
21 |
+
libvpx6 \
|
22 |
+
libxcomposite1 \
|
23 |
+
libatk1.0-0 \
|
24 |
+
libatk-bridge2.0-0 \
|
25 |
+
libepoxy0 \
|
26 |
+
libgtk-3-0 \
|
27 |
+
libharfbuzz-icu0 \
|
28 |
&& rm -rf /var/lib/apt/lists/*
|
29 |
|
30 |
+
# Set the working directory in the container
|
31 |
WORKDIR /app
|
32 |
|
33 |
+
# Copy the requirements file into the container
|
|
|
|
|
34 |
COPY requirements.txt .
|
35 |
|
36 |
+
# Install Python dependencies
|
37 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
38 |
|
39 |
+
# Install Playwright browsers
|
40 |
+
RUN playwright install
|
41 |
+
|
42 |
+
# Copy the current directory contents into the container
|
43 |
COPY . .
|
44 |
|
45 |
+
# Ensure the correct permissions for the application directory
|
46 |
+
RUN chmod -R 755 /app
|
47 |
|
48 |
+
# Expose the port the app runs on
|
49 |
+
EXPOSE 8000
|
50 |
|
51 |
+
# Command to run the FastAPI application
|
52 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|