Spaces:
Sleeping
Sleeping
WebashalarForML
commited on
Commit
•
4ff5731
1
Parent(s):
b3d0b20
Update Dockerfile
Browse files- Dockerfile +17 -13
Dockerfile
CHANGED
@@ -1,28 +1,32 @@
|
|
1 |
-
# Use
|
2 |
-
FROM
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
|
|
5 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
6 |
libgl1-mesa-glx \
|
7 |
-
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
-
# Create a non-root user
|
10 |
-
RUN useradd -m
|
11 |
|
12 |
# Set the user to the non-root user
|
13 |
USER user
|
14 |
|
15 |
-
# Add the user's local bin to the PATH
|
16 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
17 |
-
|
18 |
# Set the working directory to /app
|
19 |
WORKDIR /app
|
20 |
|
21 |
-
# Copy the requirements.txt file and install
|
22 |
-
COPY --chown=user
|
23 |
-
RUN
|
24 |
|
25 |
-
# Copy the
|
26 |
COPY --chown=user . /app
|
27 |
|
28 |
# Create the folders for uploads and results with appropriate permissions
|
|
|
1 |
+
# Use NVIDIA's CUDA base image with Python
|
2 |
+
FROM nvidia/cuda:11.8.0-runtime-ubuntu20.04
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
6 |
+
ENV PATH="/usr/local/bin:$PATH"
|
7 |
+
|
8 |
+
# Install Python and other dependencies
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
+
python3 \
|
11 |
+
python3-pip \
|
12 |
+
python3-dev \
|
13 |
libgl1-mesa-glx \
|
14 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Create a non-root user
|
17 |
+
RUN useradd -m user
|
18 |
|
19 |
# Set the user to the non-root user
|
20 |
USER user
|
21 |
|
|
|
|
|
|
|
22 |
# Set the working directory to /app
|
23 |
WORKDIR /app
|
24 |
|
25 |
+
# Copy the requirements.txt file and install dependencies
|
26 |
+
COPY --chown=user requirements.txt /app/requirements.txt
|
27 |
+
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
|
28 |
|
29 |
+
# Copy the application code into the container
|
30 |
COPY --chown=user . /app
|
31 |
|
32 |
# Create the folders for uploads and results with appropriate permissions
|