Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.9 | |
| # Create a non-root user (good practice) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set path environment variable | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy requirements first to leverage Docker cache | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| # Install dependencies | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY --chown=user . /app | |
| # Expose the port the app runs on (Hugging Face default) | |
| EXPOSE 7860 | |
| # Run uvicorn server when the container launches | |
| # CORRECTED: Points to 'morse_tts_server.py' and the 'app' object within it | |
| CMD ["uvicorn", "morse_tts_server:app", "--host", "127.0.0.1", "--port", "7860"] |