Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official NVIDIA CUDA base image, which is great for PyTorch and GPU-heavy tasks
|
| 2 |
+
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Copy the requirements file into the container
|
| 8 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
+
|
| 10 |
+
# Install dependencies from requirements.txt
|
| 11 |
+
# --no-cache-dir ensures a smaller image size
|
| 12 |
+
# --upgrade ensures we get the latest specified versions
|
| 13 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 14 |
+
|
| 15 |
+
# Copy all your application files (app.py, train.py, and your CSVs) into the container
|
| 16 |
+
COPY . /code/
|
| 17 |
+
|
| 18 |
+
# Tell the container to expose port 7860, which is the default for Gradio
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# The command to run when the container starts.
|
| 22 |
+
# This will launch your Gradio app.
|
| 23 |
+
CMD ["python", "app.py"]
|