Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -1,15 +1,20 @@
|
|
| 1 |
-
# Use a slim Python 3.11 image as the base
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Install git and other necessary dependencies
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Add a non-root user to improve security
|
| 15 |
RUN useradd -m -u 1000 user
|
|
@@ -19,7 +24,7 @@ USER user
|
|
| 19 |
ENV HOME=/home/user \
|
| 20 |
PATH=/home/user/.local/bin:$PATH
|
| 21 |
|
| 22 |
-
# Copy
|
| 23 |
COPY --chown=user . .
|
| 24 |
|
| 25 |
# Hugging Face Spaces uses port 7860 by default for Docker SDK
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
# Set the working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install git and other necessary dependencies
|
| 7 |
+
# Note: eSpeak is a critical dependency for neutts-air on a CPU.
|
| 8 |
+
RUN apt-get update && apt-get install -y git espeak && rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Clone the neutts-air repository into a temporary directory
|
| 11 |
+
RUN git clone https://github.com/neuphonic/neutts-air.git /tmp/neutts-air
|
| 12 |
+
|
| 13 |
+
# Install dependencies from the cloned project's requirements.txt
|
| 14 |
+
RUN pip install --no-cache-dir --upgrade -r /tmp/neutts-air/requirements.txt
|
| 15 |
+
|
| 16 |
+
# Clean up temporary files
|
| 17 |
+
RUN rm -rf /tmp/neutts-air
|
| 18 |
|
| 19 |
# Add a non-root user to improve security
|
| 20 |
RUN useradd -m -u 1000 user
|
|
|
|
| 24 |
ENV HOME=/home/user \
|
| 25 |
PATH=/home/user/.local/bin:$PATH
|
| 26 |
|
| 27 |
+
# Copy your local project files to the container
|
| 28 |
COPY --chown=user . .
|
| 29 |
|
| 30 |
# Hugging Face Spaces uses port 7860 by default for Docker SDK
|