Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +12 -6
Dockerfile
CHANGED
@@ -1,17 +1,23 @@
|
|
1 |
-
# Use
|
2 |
-
FROM
|
3 |
|
4 |
-
# Set the working directory
|
5 |
WORKDIR /code
|
6 |
|
7 |
# Copy the requirements file
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
9 |
|
10 |
-
# Install
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
12 |
|
13 |
-
# Copy the
|
14 |
COPY . .
|
15 |
|
16 |
-
# Specify the command to run on container start
|
17 |
CMD ["python", "caption_api.py", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use NVIDIA CUDA base image
|
2 |
+
FROM nvidia/cuda:11.4.1-cudnn8-devel-ubuntu20.04
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /code
|
6 |
|
7 |
# Copy the requirements file
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
9 |
|
10 |
+
# Install required dependencies, including CUDA toolkit
|
11 |
+
RUN apt-get update && \
|
12 |
+
apt-get install -y --no-install-recommends \
|
13 |
+
cuda-toolkit-11-4 && \
|
14 |
+
rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
# Install Python dependencies
|
17 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
18 |
|
19 |
+
# Copy the rest of the application code
|
20 |
COPY . .
|
21 |
|
22 |
+
# Specify the default command to run on container start
|
23 |
CMD ["python", "caption_api.py", "--host", "0.0.0.0", "--port", "7860"]
|