Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +36 -3
Dockerfile
CHANGED
@@ -3,18 +3,23 @@ FROM python:3.8
|
|
3 |
# Install required system dependencies
|
4 |
RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
|
5 |
|
|
|
|
|
|
|
|
|
6 |
# Set the working directory inside the container
|
7 |
WORKDIR /app
|
8 |
|
|
|
|
|
|
|
|
|
9 |
# Copy the requirements file into the container
|
10 |
COPY requirements.txt .
|
11 |
|
12 |
# Install dependencies
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
-
# Create necessary directories (but don't download models here!)
|
16 |
-
RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
|
17 |
-
|
18 |
# Copy the entire project to the container
|
19 |
COPY . .
|
20 |
|
@@ -25,6 +30,34 @@ EXPOSE 7860
|
|
25 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
# # Use Python 3.8 as the base image
|
29 |
# FROM python:3.8
|
30 |
|
|
|
3 |
# Install required system dependencies
|
4 |
RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
|
5 |
|
6 |
+
# Set environment variables for cache
|
7 |
+
ENV TRANSFORMERS_CACHE=/app/cache/huggingface
|
8 |
+
ENV NUMBA_CACHE_DIR=/app/cache/numba
|
9 |
+
|
10 |
# Set the working directory inside the container
|
11 |
WORKDIR /app
|
12 |
|
13 |
+
# Create necessary directories
|
14 |
+
RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples \
|
15 |
+
&& mkdir -p $TRANSFORMERS_CACHE $NUMBA_CACHE_DIR
|
16 |
+
|
17 |
# Copy the requirements file into the container
|
18 |
COPY requirements.txt .
|
19 |
|
20 |
# Install dependencies
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
|
|
|
|
|
|
23 |
# Copy the entire project to the container
|
24 |
COPY . .
|
25 |
|
|
|
30 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
31 |
|
32 |
|
33 |
+
|
34 |
+
# FROM python:3.8
|
35 |
+
|
36 |
+
# # Install required system dependencies
|
37 |
+
# RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
|
38 |
+
|
39 |
+
# # Set the working directory inside the container
|
40 |
+
# WORKDIR /app
|
41 |
+
|
42 |
+
# # Copy the requirements file into the container
|
43 |
+
# COPY requirements.txt .
|
44 |
+
|
45 |
+
# # Install dependencies
|
46 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
47 |
+
|
48 |
+
# # Create necessary directories (but don't download models here!)
|
49 |
+
# RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
|
50 |
+
|
51 |
+
# # Copy the entire project to the container
|
52 |
+
# COPY . .
|
53 |
+
|
54 |
+
# # Expose the port for Flask
|
55 |
+
# EXPOSE 7860
|
56 |
+
|
57 |
+
# # Run the app with Gunicorn
|
58 |
+
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
59 |
+
|
60 |
+
|
61 |
# # Use Python 3.8 as the base image
|
62 |
# FROM python:3.8
|
63 |
|