tenderapi / Dockerfile
aniket9909's picture
Create Dockerfile
99012f3 verified
# Use a small Python image
FROM python:3.10-slim
# Prevents Python from writing .pyc files and buffers logs (better for containers)
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Create app directory
WORKDIR /home/user/app
# System deps (optional: add build tools if you need them)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python deps
COPY requirements.txt /home/user/app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy your app code
COPY . /home/user/app
# Expose the port Hugging Face expects
EXPOSE 7860
ENV PORT=7860
# Run the FastAPI app
# NOTE: app:app -> <module>:<FastAPI instance name>
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]