AEGIS-SECURE-API / Dockerfile
Akshat Bhatt
added code
e2e0c18
raw
history blame
973 Bytes
# Use Python 3.10 slim image as base
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies for SSL, whois, and other required tools
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& curl --version
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the entire Model_sprint_2 directory
COPY . .
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Expose the port the app runs on
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Run the application using uvicorn
CMD ["python", "-m", "uvicorn", "app1:app", "--host", "0.0.0.0", "--port", "8000"]