Update Dockerfile
Browse files- Dockerfile +7 -15
Dockerfile
CHANGED
@@ -1,32 +1,24 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
# System
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
libgl1 \
|
7 |
libglib2.0-0 \
|
8 |
libsm6 \
|
9 |
libxext6 \
|
10 |
-
|
11 |
-
fonts-dejavu \
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
-
#
|
15 |
-
ENV
|
16 |
-
|
17 |
-
|
18 |
-
PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9 \
|
19 |
-
TF_CPP_MIN_LOG_LEVEL=3
|
20 |
-
|
21 |
-
# Create writable directories
|
22 |
-
RUN mkdir -p ${MPLCONFIGDIR} \
|
23 |
-
&& mkdir -p ${FONTCONFIG_PATH} \
|
24 |
-
&& chmod -R 777 /tmp
|
25 |
|
26 |
WORKDIR /app
|
27 |
COPY . .
|
28 |
|
29 |
-
# Install
|
30 |
RUN pip install --no-cache-dir -U pip && \
|
31 |
pip install --no-cache-dir -r requirements.txt
|
32 |
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# System dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
libgl1 \
|
7 |
libglib2.0-0 \
|
8 |
libsm6 \
|
9 |
libxext6 \
|
10 |
+
g++ \
|
|
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Configure environment
|
14 |
+
ENV XDG_CACHE_HOME=/tmp \
|
15 |
+
TORCH_USE_CUDA_DSA=1 \
|
16 |
+
PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
WORKDIR /app
|
19 |
COPY . .
|
20 |
|
21 |
+
# Install with optimized dependencies
|
22 |
RUN pip install --no-cache-dir -U pip && \
|
23 |
pip install --no-cache-dir -r requirements.txt
|
24 |
|