CapstoneFastAPI / Dockerfile
AlekhyaC2005's picture
first commit
46fb1fc
# =========================================================
# BASE IMAGE
# =========================================================
FROM python:3.11-slim
# =========================================================
# ENV VARIABLES
# =========================================================
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# =========================================================
# WORK DIRECTORY
# =========================================================
WORKDIR /app
# =========================================================
# INSTALL SYSTEM DEPENDENCIES
# =========================================================
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# =========================================================
# COPY REQUIREMENTS
# =========================================================
COPY requirements.txt .
# =========================================================
# INSTALL PYTHON DEPENDENCIES
# =========================================================
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# =========================================================
# COPY PROJECT FILES
# =========================================================
COPY . .
# =========================================================
# EXPOSE PORT
# =========================================================
EXPOSE 7860
# =========================================================
# START FASTAPI
# =========================================================
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]