ramouch/Tunisian-Encoder
0
1# Use a minimal base image2FROM python:3.9-slim3 4# Create a non-root user for security5RUN useradd -m user6USER user7 8# Set environment variables9ENV HOME=/home/user \10 PATH=/home/user/.local/bin:$PATH \11 PORT=786012 13# Set the working directory14WORKDIR $HOME/app15 16# Copy requirements and install dependencies in a single RUN command17COPY --chown=user requirements.txt ./18RUN pip install --upgrade pip && \19 pip install -r requirements.txt20 21# Copy application files and the model22COPY --chown=user ./ $HOME/app23 24# Expose the correct port for Hugging Face Spaces25EXPOSE 786026 27# Run the FastAPI app with uvicorn directly for lightweight deployment28CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]