Update Dockerfile
Browse files- Dockerfile +14 -4
Dockerfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# Base image
|
2 |
FROM python:3.10-slim as base
|
3 |
|
4 |
-
# Chrome dependency installation
|
5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
6 |
fonts-liberation \
|
7 |
libasound2 \
|
@@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
24 |
xdg-utils \
|
25 |
libu2f-udev \
|
26 |
libvulkan1 \
|
|
|
27 |
curl \
|
28 |
&& rm -rf /var/lib/apt/lists/*
|
29 |
|
@@ -36,11 +37,20 @@ RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd
|
|
36 |
# Check Chrome version
|
37 |
RUN google-chrome --version
|
38 |
|
39 |
-
#
|
40 |
-
RUN mkdir -p /root/.cache/selenium &&
|
|
|
|
|
|
|
41 |
|
42 |
-
#
|
|
|
43 |
ENV XDG_CACHE_HOME=/root/.cache
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
# Copy application files
|
46 |
COPY requirements.txt .
|
|
|
1 |
# Base image
|
2 |
FROM python:3.10-slim as base
|
3 |
|
4 |
+
# Chrome and system dependency installation
|
5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
6 |
fonts-liberation \
|
7 |
libasound2 \
|
|
|
24 |
xdg-utils \
|
25 |
libu2f-udev \
|
26 |
libvulkan1 \
|
27 |
+
fontconfig \
|
28 |
curl \
|
29 |
&& rm -rf /var/lib/apt/lists/*
|
30 |
|
|
|
37 |
# Check Chrome version
|
38 |
RUN google-chrome --version
|
39 |
|
40 |
+
# Create cache directories and set proper permissions
|
41 |
+
RUN mkdir -p /root/.cache/selenium && \
|
42 |
+
mkdir -p /root/.config/matplotlib && \
|
43 |
+
mkdir -p /root/.cache/fontconfig && \
|
44 |
+
chmod -R 777 /root/.cache/selenium /root/.config/matplotlib /root/.cache/fontconfig
|
45 |
|
46 |
+
# Set environment variables for Matplotlib and Fontconfig
|
47 |
+
ENV MPLCONFIGDIR=/root/.config/matplotlib
|
48 |
ENV XDG_CACHE_HOME=/root/.cache
|
49 |
+
ENV FONTCONFIG_PATH=/root/.cache/fontconfig
|
50 |
+
|
51 |
+
# Download the missing frpc_linux_amd64_v0.2 for Gradio
|
52 |
+
RUN curl -L https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 -o /usr/local/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2 && \
|
53 |
+
chmod +x /usr/local/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2
|
54 |
|
55 |
# Copy application files
|
56 |
COPY requirements.txt .
|