Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +65 -12
Dockerfile
CHANGED
|
@@ -1,10 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Install system packages
|
| 7 |
-
RUN apt-get update &&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Set environment for proper model caching and permissions
|
| 10 |
ENV PYTHONUNBUFFERED=1
|
|
@@ -19,12 +72,7 @@ RUN mkdir -p /app/pretrained_models \
|
|
| 19 |
/app/.cache/whisper \
|
| 20 |
/app/.cache/speechbrain \
|
| 21 |
/app/tmp \
|
| 22 |
-
&& chmod -R 777 /app
|
| 23 |
-
/app/wav2vec2_checkpoints \
|
| 24 |
-
/app/pretrained_asr \
|
| 25 |
-
/app/.cache \
|
| 26 |
-
/app/tmp \
|
| 27 |
-
/app
|
| 28 |
|
| 29 |
# Upgrade pip
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
|
|
@@ -32,14 +80,19 @@ RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
|
|
| 32 |
# Copy source
|
| 33 |
COPY . .
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
# Download Hugging Face interface file
|
| 36 |
RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
|
| 37 |
|
| 38 |
# Install Python dependencies
|
| 39 |
RUN pip install --no-cache-dir -r requirements.txt --root-user-action=ignore
|
| 40 |
|
| 41 |
-
# Expose Streamlit
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
#
|
| 45 |
-
CMD ["
|
|
|
|
| 1 |
+
# FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# # Set working directory
|
| 4 |
+
# WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# # Install system packages
|
| 7 |
+
# RUN apt-get update && apt-get install -y ffmpeg git wget && rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# # Set environment for proper model caching and permissions
|
| 10 |
+
# ENV PYTHONUNBUFFERED=1
|
| 11 |
+
# ENV HOME=/app
|
| 12 |
+
# ENV XDG_CACHE_HOME=/app/.cache
|
| 13 |
+
# ENV SPEECHBRAIN_CACHE=/app/.cache/speechbrain
|
| 14 |
+
|
| 15 |
+
# # Create all needed directories with write permissions
|
| 16 |
+
# RUN mkdir -p /app/pretrained_models \
|
| 17 |
+
# /app/wav2vec2_checkpoints \
|
| 18 |
+
# /app/pretrained_asr \
|
| 19 |
+
# /app/.cache/whisper \
|
| 20 |
+
# /app/.cache/speechbrain \
|
| 21 |
+
# /app/tmp \
|
| 22 |
+
# && chmod -R 777 /app/pretrained_models \
|
| 23 |
+
# /app/wav2vec2_checkpoints \
|
| 24 |
+
# /app/pretrained_asr \
|
| 25 |
+
# /app/.cache \
|
| 26 |
+
# /app/tmp \
|
| 27 |
+
# /app
|
| 28 |
+
|
| 29 |
+
# # Upgrade pip
|
| 30 |
+
# RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
|
| 31 |
+
|
| 32 |
+
# # Copy source
|
| 33 |
+
# COPY . .
|
| 34 |
+
|
| 35 |
+
# # Download Hugging Face interface file
|
| 36 |
+
# RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
|
| 37 |
+
|
| 38 |
+
# # Install Python dependencies
|
| 39 |
+
# RUN pip install --no-cache-dir -r requirements.txt --root-user-action=ignore
|
| 40 |
+
|
| 41 |
+
# # Expose Streamlit port
|
| 42 |
+
# EXPOSE 8501
|
| 43 |
+
|
| 44 |
+
# # Run Streamlit app
|
| 45 |
+
# CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501"]
|
| 46 |
+
|
| 47 |
+
|
| 48 |
FROM python:3.10-slim
|
| 49 |
|
| 50 |
# Set working directory
|
| 51 |
WORKDIR /app
|
| 52 |
|
| 53 |
+
# Install system packages and Ollama dependencies
|
| 54 |
+
RUN apt-get update && \
|
| 55 |
+
apt-get install -y ffmpeg git wget curl gnupg && \
|
| 56 |
+
rm -rf /var/lib/apt/lists/*
|
| 57 |
+
|
| 58 |
+
# Install Ollama
|
| 59 |
+
# Use the official install script for robust installation
|
| 60 |
+
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 61 |
|
| 62 |
# Set environment for proper model caching and permissions
|
| 63 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
| 72 |
/app/.cache/whisper \
|
| 73 |
/app/.cache/speechbrain \
|
| 74 |
/app/tmp \
|
| 75 |
+
&& chmod -R 777 /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
# Upgrade pip
|
| 78 |
RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
|
|
|
|
| 80 |
# Copy source
|
| 81 |
COPY . .
|
| 82 |
|
| 83 |
+
# Copy the startup script and make it executable
|
| 84 |
+
COPY start.sh /usr/local/bin/start.sh
|
| 85 |
+
RUN chmod +x /usr/local/bin/start.sh
|
| 86 |
+
|
| 87 |
# Download Hugging Face interface file
|
| 88 |
RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
|
| 89 |
|
| 90 |
# Install Python dependencies
|
| 91 |
RUN pip install --no-cache-dir -r requirements.txt --root-user-action=ignore
|
| 92 |
|
| 93 |
+
# Expose both Streamlit and Ollama ports (for internal communication within Docker, if needed)
|
| 94 |
+
# Hugging Face Spaces will likely only expose the main Streamlit port
|
| 95 |
+
EXPOSE 8501 11434
|
| 96 |
|
| 97 |
+
# Use the startup script as the CMD
|
| 98 |
+
CMD ["/usr/local/bin/start.sh"]
|