Spaces:
Sleeping
Sleeping
Commit
·
8f3097b
1
Parent(s):
b0095ef
changes
Browse files- Dockerfile +17 -2
Dockerfile
CHANGED
@@ -1,14 +1,29 @@
|
|
|
|
|
|
1 |
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
|
|
|
4 |
RUN useradd -m -u 1000 user
|
5 |
USER user
|
6 |
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
|
|
|
8 |
WORKDIR /app
|
9 |
|
|
|
10 |
COPY --chown=user ./requirements.txt requirements.txt
|
11 |
-
RUN
|
|
|
|
|
|
|
12 |
|
|
|
13 |
COPY --chown=user . /app
|
|
|
|
|
14 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use the NVIDIA CUDA image with CUDNN and development tools
|
2 |
+
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
|
3 |
|
4 |
+
# Install Python and pip
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y python3.9 python3.9-dev python3-pip && \
|
7 |
+
apt-get clean && \
|
8 |
+
rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
+
# Create a user with UID 1000
|
11 |
RUN useradd -m -u 1000 user
|
12 |
USER user
|
13 |
ENV PATH="/home/user/.local/bin:$PATH"
|
14 |
|
15 |
+
# Set the working directory
|
16 |
WORKDIR /app
|
17 |
|
18 |
+
# Copy the requirements file and install dependencies
|
19 |
COPY --chown=user ./requirements.txt requirements.txt
|
20 |
+
RUN pip3 install --upgrade pip
|
21 |
+
RUN pip3 install packaging
|
22 |
+
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
|
23 |
+
RUN pip3 install flash_attn
|
24 |
|
25 |
+
# Copy the rest of the application
|
26 |
COPY --chown=user . /app
|
27 |
+
|
28 |
+
# Command to run the application
|
29 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|