Spaces:
Paused
Paused
Rename Dockerfile to dockerfile
Browse files- Dockerfile → dockerfile +14 -16
Dockerfile → dockerfile
RENAMED
|
@@ -9,9 +9,6 @@ ENV HF_HOME=/app/cache
|
|
| 9 |
ENV NUMBA_CACHE_DIR=/app/cache/numba_cache
|
| 10 |
ENV CUDA_VISIBLE_DEVICES=""
|
| 11 |
|
| 12 |
-
# Ensure user-local bin is on PATH so scripts installed into ~/.local/bin are discoverable
|
| 13 |
-
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
| 14 |
-
|
| 15 |
# Install essential system dependencies
|
| 16 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 17 |
git \
|
|
@@ -20,7 +17,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
libsndfile1 \
|
| 21 |
ffmpeg \
|
| 22 |
curl \
|
| 23 |
-
ca-certificates \
|
| 24 |
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
|
| 26 |
# Set the working directory
|
|
@@ -30,23 +26,25 @@ WORKDIR /app
|
|
| 30 |
# Create a new user 'appuser' with UID 1000 and create their home directory
|
| 31 |
RUN useradd --create-home --uid 1000 appuser
|
| 32 |
|
| 33 |
-
# Switch to root
|
| 34 |
-
USER root
|
| 35 |
-
RUN mkdir -p /app/cache && chown -R appuser:appuser /app /app/cache
|
| 36 |
USER appuser
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
# Copy requirements and install
|
| 45 |
COPY --chown=appuser:appuser requirements.txt .
|
| 46 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 47 |
|
| 48 |
-
# Clone the NeuTTS Air repository
|
| 49 |
-
RUN git clone
|
| 50 |
|
| 51 |
# Copy the application code
|
| 52 |
COPY --chown=appuser:appuser app.py .
|
|
@@ -58,5 +56,5 @@ EXPOSE 7860
|
|
| 58 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 59 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 60 |
|
| 61 |
-
#
|
| 62 |
-
CMD ["
|
|
|
|
| 9 |
ENV NUMBA_CACHE_DIR=/app/cache/numba_cache
|
| 10 |
ENV CUDA_VISIBLE_DEVICES=""
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
# Install essential system dependencies
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
git \
|
|
|
|
| 17 |
libsndfile1 \
|
| 18 |
ffmpeg \
|
| 19 |
curl \
|
|
|
|
| 20 |
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
|
| 22 |
# Set the working directory
|
|
|
|
| 26 |
# Create a new user 'appuser' with UID 1000 and create their home directory
|
| 27 |
RUN useradd --create-home --uid 1000 appuser
|
| 28 |
|
| 29 |
+
# Switch to the non-root user
|
|
|
|
|
|
|
| 30 |
USER appuser
|
| 31 |
|
| 32 |
+
# ---- Add this line to fix the PATH issue ----
|
| 33 |
+
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
| 34 |
|
| 35 |
+
# Create the cache directory and set ownership to the new user
|
| 36 |
+
# This needs to run as root, so we'll adjust the Dockerfile structure slightly
|
| 37 |
+
USER root
|
| 38 |
+
RUN mkdir -p /app/cache && chown -R appuser:appuser /app /app/cache
|
| 39 |
+
USER appuser
|
| 40 |
+
# ---- END: Non-Root User Configuration ----
|
| 41 |
|
| 42 |
+
# Copy requirements file and install dependencies as the non-root user
|
| 43 |
COPY --chown=appuser:appuser requirements.txt .
|
| 44 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 45 |
|
| 46 |
+
# Clone the NeuTTS Air repository
|
| 47 |
+
RUN git clone https://github.com/neuphonic/neutts-air.git
|
| 48 |
|
| 49 |
# Copy the application code
|
| 50 |
COPY --chown=appuser:appuser app.py .
|
|
|
|
| 56 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 57 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 58 |
|
| 59 |
+
# Set the command to run the application
|
| 60 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|