STT-Bot / Dockerfile
slim-S's picture
chore: update
d70912d
Raw
History Blame Contribute Delete
695 Bytes
# Use a Python 3.10 base image
FROM python:3.10-slim
# Set working directory
WORKDIR ./
# 1. First install dependencies as root
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 2. Create non-root user and data directories
RUN useradd -m -u 1000 appuser && \
mkdir -p /data/processed/text /data/processed/voice \
/data/pending/text /data/pending/voice && \
chown -R appuser:appuser /data
# 3. Switch to non-root user
USER appuser
# 4. Copy app files (now owned by appuser)
COPY --chown=appuser . .
# Change the command to use main.py instead of app.py
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]