Spaces:
Paused
Paused
Rename Dockerfile to dockerfile
Browse files- Dockerfile → dockerfile +13 -12
Dockerfile → dockerfile
RENAMED
|
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 17 |
libsndfile1 \
|
| 18 |
ffmpeg \
|
| 19 |
curl \
|
|
|
|
| 20 |
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
|
| 22 |
# Set the working directory
|
|
@@ -26,25 +27,25 @@ WORKDIR /app
|
|
| 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
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 .
|
|
|
|
| 17 |
libsndfile1 \
|
| 18 |
ffmpeg \
|
| 19 |
curl \
|
| 20 |
+
ca-certificates \
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
# Set the working directory
|
|
|
|
| 27 |
# Create a new user 'appuser' with UID 1000 and create their home directory
|
| 28 |
RUN useradd --create-home --uid 1000 appuser
|
| 29 |
|
| 30 |
+
# Switch to root to create dirs and set permissions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
USER root
|
| 32 |
RUN mkdir -p /app/cache && chown -R appuser:appuser /app /app/cache
|
| 33 |
USER appuser
|
|
|
|
| 34 |
|
| 35 |
+
# Ensure pip is up-to-date for wheel installs
|
| 36 |
+
RUN python -m pip install --upgrade pip
|
| 37 |
+
|
| 38 |
+
# Install CPU-only PyTorch and torchaudio from official index (explicit CPU builds)
|
| 39 |
+
# Pin versions appropriately - adjust versions if needed.
|
| 40 |
+
# Using the official torch wheel index ensures CPU-only wheels are used, avoiding GPU ABI mismatches.
|
| 41 |
+
RUN pip install --no-cache-dir "torch==2.2.0+cpu" "torchaudio==2.2.0+cpu" -f https://download.pytorch.org/whl/torch_stable.html
|
| 42 |
+
|
| 43 |
+
# Copy requirements and install remaining dependencies as non-root user
|
| 44 |
COPY --chown=appuser:appuser requirements.txt .
|
| 45 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 46 |
|
| 47 |
+
# Clone the NeuTTS Air repository (shallow to save space)
|
| 48 |
+
RUN git clone --depth 1 https://github.com/neuphonic/neutts-air.git
|
| 49 |
|
| 50 |
# Copy the application code
|
| 51 |
COPY --chown=appuser:appuser app.py .
|