Spaces:
Runtime error
Runtime error
Commit ·
d66d8f0
1
Parent(s): 84379c8
Refactor Dockerfile and compose.yml to clean up commented sections and improve readability
Browse files- Dockerfile +13 -5
- compose.yml +0 -8
Dockerfile
CHANGED
|
@@ -7,16 +7,24 @@ WORKDIR /app
|
|
| 7 |
ENV PYTHONUNBUFFERED=1
|
| 8 |
|
| 9 |
# Install system dependencies required for sentence-transformers and OpenCV
|
| 10 |
-
RUN apt-get update && apt-get install -y \
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Copy the requirements file into the container at /app
|
| 16 |
COPY requirements.txt .
|
| 17 |
|
| 18 |
# Install any needed packages specified in requirements.txt
|
| 19 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Copy the rest of the application's code into the container at /app
|
| 22 |
COPY . .
|
|
|
|
| 7 |
ENV PYTHONUNBUFFERED=1
|
| 8 |
|
| 9 |
# Install system dependencies required for sentence-transformers and OpenCV
|
| 10 |
+
# RUN apt-get update && apt-get install -y \
|
| 11 |
+
# libgl1 \
|
| 12 |
+
# libglib2.0-0 \
|
| 13 |
+
# && rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
RUN apt-get update \
|
| 16 |
+
&& apt-get install -y --no-install-recommends libgl1 libglib2.0-0 \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
# Copy the requirements file into the container at /app
|
| 20 |
COPY requirements.txt .
|
| 21 |
|
| 22 |
# Install any needed packages specified in requirements.txt
|
| 23 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
+
COPY requirements.txt .
|
| 25 |
+
RUN pip install --no-cache-dir --upgrade pip \
|
| 26 |
+
&& pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu \
|
| 27 |
+
&& pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
# Copy the rest of the application's code into the container at /app
|
| 30 |
COPY . .
|
compose.yml
CHANGED
|
@@ -84,12 +84,4 @@ services:
|
|
| 84 |
|
| 85 |
# Memory constraints for 4GB DigitalOcean droplet
|
| 86 |
# Allocate 1.5GB to app, leaving room for Milvus and system
|
| 87 |
-
mem_limit: 1536m
|
| 88 |
-
memswap_limit: 1536m
|
| 89 |
|
| 90 |
-
# depends_on:
|
| 91 |
-
# - standalone
|
| 92 |
-
|
| 93 |
-
networks:
|
| 94 |
-
default:
|
| 95 |
-
name: milvus
|
|
|
|
| 84 |
|
| 85 |
# Memory constraints for 4GB DigitalOcean droplet
|
| 86 |
# Allocate 1.5GB to app, leaving room for Milvus and system
|
|
|
|
|
|
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|