Spaces:
Paused
Paused
Upload Dockerfile
Browse files- Dockerfile +64 -36
Dockerfile
CHANGED
|
@@ -1,36 +1,64 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
-
|
| 3 |
-
# Set working directory
|
| 4 |
-
WORKDIR /app
|
| 5 |
-
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
#
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
#
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
#
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
#
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# # Set working directory
|
| 4 |
+
# WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# # Copy everything into the container
|
| 7 |
+
# COPY . /app
|
| 8 |
+
|
| 9 |
+
# # Create a writable config directory for Matplotlib
|
| 10 |
+
# RUN mkdir -p /app/.config/matplotlib
|
| 11 |
+
|
| 12 |
+
# # Set environment variables for Hugging Face + Matplotlib
|
| 13 |
+
# ENV MPLCONFIGDIR=/app/.config/matplotlib \
|
| 14 |
+
# PYTHONUNBUFFERED=1 \
|
| 15 |
+
# PIP_NO_CACHE_DIR=1
|
| 16 |
+
|
| 17 |
+
# # Install dependencies
|
| 18 |
+
# RUN pip install --upgrade pip && \
|
| 19 |
+
# pip install -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# # Run setup script (e.g., download models)
|
| 22 |
+
# RUN chmod +x setup.sh && ./setup.sh
|
| 23 |
+
|
| 24 |
+
# # Expose port for Streamlit
|
| 25 |
+
# EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# # Command to run Streamlit app
|
| 28 |
+
# CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 29 |
+
# Start from NVIDIA’s CUDA image with cuDNN support
|
| 30 |
+
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
|
| 31 |
+
|
| 32 |
+
# Set working directory
|
| 33 |
+
WORKDIR /app
|
| 34 |
+
|
| 35 |
+
# Install Python + essentials
|
| 36 |
+
RUN apt-get update && \
|
| 37 |
+
apt-get install -y python3.10 python3.10-venv python3-pip && \
|
| 38 |
+
rm -rf /var/lib/apt/lists/*
|
| 39 |
+
|
| 40 |
+
# Copy everything into the container
|
| 41 |
+
COPY . /app
|
| 42 |
+
|
| 43 |
+
# Create a writable config directory for Matplotlib
|
| 44 |
+
RUN mkdir -p /app/.config/matplotlib
|
| 45 |
+
|
| 46 |
+
# Set environment variables
|
| 47 |
+
ENV MPLCONFIGDIR=/app/.config/matplotlib \
|
| 48 |
+
PYTHONUNBUFFERED=1 \
|
| 49 |
+
PIP_NO_CACHE_DIR=1
|
| 50 |
+
|
| 51 |
+
# Upgrade pip and install dependencies
|
| 52 |
+
RUN python3.10 -m pip install --upgrade pip && \
|
| 53 |
+
pip install -r requirements.txt
|
| 54 |
+
|
| 55 |
+
# Run setup script (e.g., download models)
|
| 56 |
+
RUN chmod +x setup.sh && ./setup.sh
|
| 57 |
+
|
| 58 |
+
# Expose Streamlit port
|
| 59 |
+
EXPOSE 7860
|
| 60 |
+
|
| 61 |
+
# Command to run Streamlit app
|
| 62 |
+
CMD ["streamlit", "run", "test_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 63 |
+
|
| 64 |
+
|