Stem-Extractor / Dockerfile
samarth-ht's picture
fix: replace CMD with RUN command to list files in Dockerfile
1489e52
raw
history blame
2.24 kB
# Use the official PyTorch image as the base
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# Labels
LABEL maintainer="Jacob Schmieder"
LABEL email="[email protected]"
LABEL version="0.1.1.dev"
LABEL description="Scraibe is a tool for automatic speech recognition and speaker diarization. \
It is based on the Hugging Face Transformers library and the Pyannote library. \
It is designed to be used with the Whisper model, a lightweight model for automatic \
speech recognition and speaker diarization."
LABEL url="https://github.com/JSchmie/ScrAIbe"
# Set up a new user named "hyathi" with user ID 1000
RUN useradd -m -u 1000 hyathi
RUN usermod -aG sudo hyathi
# Install sudo and add user to sudoers group
RUN apt update -y && apt install -y sudo
# Allow the user to run apt commands without a password prompt by modifying sudoers file
RUN echo "hyathi ALL=(ALL) NOPASSWD: /usr/bin/apt, /bin/rm" >> /etc/sudoers
# Switch to the new user
USER hyathi
# Set home to the user's home directory
ENV HOME=/home/hyathi \
PATH=/home/hyathi/.local/bin:$PATH
# Set the working directory
WORKDIR $HOME/app
# Environment dependencies
ENV TRANSFORMERS_CACHE=$HOME/app/models
ENV HF_HOME=$HOME/app/models
ENV AUTOT_CACHE=$HOME/app/models
ENV PYANNOTE_CACHE=$HOME/app/models/pyannote
# Copy all necessary files
COPY requirements.txt $HOME/app/requirements.txt
COPY README.md $HOME/app/README.md
COPY scraibe $HOME/app/scraibe
# Installing all necessary dependencies and running the application with a personalized Hugging-Face-Token
RUN sudo apt update -y && sudo apt upgrade -y && \
sudo apt install -y libsm6 libxrender1 libfontconfig1 && \
sudo apt clean && \
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Update Conda and install libsndfile
# RUN sudo conda update --all && \
# sudo conda install -c conda-forge libsndfile && \
# sudo conda clean --all -y
# Install Python dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR $HOME/app
RUN ls
# Expose the port for the app
EXPOSE 7860
# Run the application
CMD ["uvicorn", "app.app:app", "--host", "127.0.0.1", "--port", "7860", "--reload"]