Upload 2 files
Browse files- Dockerfile +32 -0
- requirements.txt +6 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
+
# you will also find guides on how best to write your Dockerfile
|
| 3 |
+
|
| 4 |
+
# Use a stable and available Python version
|
| 5 |
+
FROM python:3.11
|
| 6 |
+
|
| 7 |
+
# Install ffmpeg
|
| 8 |
+
RUN apt-get update && apt-get install -y ffmpeg
|
| 9 |
+
|
| 10 |
+
# Create a non - root user
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
+
USER user
|
| 13 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 14 |
+
|
| 15 |
+
# Set the working directory
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
|
| 18 |
+
# Copy the requirements file
|
| 19 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 20 |
+
|
| 21 |
+
# Install Python dependencies
|
| 22 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 23 |
+
|
| 24 |
+
# Copy all files from the build context to the container
|
| 25 |
+
COPY --chown=user . /app
|
| 26 |
+
|
| 27 |
+
# Set permissions for all files and directories
|
| 28 |
+
RUN find /app -type f -exec chmod 644 {} \; && \
|
| 29 |
+
find /app -type d -exec chmod 755 {} \;
|
| 30 |
+
|
| 31 |
+
# Set the command to run your application
|
| 32 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
uvicorn
|
| 3 |
+
git+https://github.com/jakiepari/deezspot
|
| 4 |
+
python-multipart
|
| 5 |
+
python-dotenv
|
| 6 |
+
requests
|