api-ask-al-quran/Dockerfile
2025-06-29 07:35:38 +00:00

41 lines
958 B
Docker

# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set environment variables
ENV GROQ_API_KEY "add your GROQ API key here"
ENV VIRTUAL_ENV="/opt/venv"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Set work directory
WORKDIR /app
# Install system dependencies
# RUN apt-get update && apt-get install -y --no-install-recommends \
# gcc \
# python3-dev \
# && rm -rf /var/lib/apt/lists/*
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements file
COPY requirements.txt .
COPY ./app/quran_arabic.csv .
# Create and activate virtual environment
RUN python -m venv $VIRTUAL_ENV
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy project
COPY . .
# Expose the port the app runs on
EXPOSE 8000
# Command to run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]