Medical-Chatbot-API / Dockerfile
khalednabawi11's picture
Create Dockerfile
75c7b83 verified
raw
history blame
709 Bytes
FROM python:3.9-slim
WORKDIR /code
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code (excluding models)
COPY app /code/app
COPY main.py .
# Create models directory
RUN mkdir -p /code/models
# Set environment variables
ENV HOST=0.0.0.0
ENV PORT=7860
# Expose the port that FastAPI will run on
EXPOSE 7860
# Command to run the FastAPI application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]