Files
task_fraud_detection_bolade/Dockerfile
T
boladeE a70c0802ae Update project structure and configuration
- Enhanced .gitignore to include additional Python-related files.
- Updated docker-compose.yml to version 3.8, added container name, health check, and network configuration.
- Modified Dockerfile to set environment variables, install system dependencies, and add a health check.
- Updated requirements.txt with specific package versions.
- Removed obsolete files related to cloud deployment and experiments.
- Improved EDA notebook with additional data loading and exploration steps.
2025-04-25 17:53:04 +01:00

34 lines
824 B
Docker

FROM python:3.9-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create necessary directories
RUN mkdir -p data/raw data/processed models
# Expose ports for API
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Command to run the API
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]