File size: 1,201 Bytes
af4e958
 
 
3818a51
 
af4e958
 
 
 
 
 
 
 
 
 
ea9eade
3818a51
 
af4e958
3818a51
 
 
af4e958
3818a51
af4e958
3818a51
 
af4e958
 
ea9eade
3818a51
af4e958
3818a51
af4e958
ea9eade
 
3818a51
af4e958
ea9eade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# FraudShield - OpenEnv Fraud Detection Environment
# Production-grade Docker image for e-commerce fraud review

FROM python:3.11-slim

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PORT=7860

# Add metadata labels
LABEL maintainer="Devika J <devikaj2005@gmail.com>" \
      description="FraudShield - OpenEnv environment for marketplace fraud detection" \
      version="0.2.0" \
      org.opencontainers.image.source="https://github.com/DevikaJ2005/fraudshield"

WORKDIR /app

# Install system dependencies (minimal for production)
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/* && apt-get clean

# Copy project files
COPY . .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir .

EXPOSE $PORT

# Health check for container orchestration
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
    CMD curl -fsS http://localhost:${PORT}/health || exit 1

# Run FastAPI application
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]