tienhiep-translation / Dockerfile
Cong123779's picture
Initial deploy of Standalone Vietphrase Translation API
723ba31 verified
raw
history blame contribute delete
614 Bytes
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
# Create user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH PYTHONUNBUFFERED=1
WORKDIR $HOME/app
# Copy requirements
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY --chown=user . .
# Expose port 7860
EXPOSE 7860
# Run FastAPI via Uvicorn
CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"]