FROM python:3.14-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

# Install openssl for SSL certificate support
RUN apt-get update && apt-get install -y --no-install-recommends \
    openssl \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

# Copy application source code
COPY . /app/

# Make sure entrypoint script is executable
RUN chmod +x /app/entrypoint.sh

# Expose port: 5000 (HTTP/HTTPS Hybrid)
EXPOSE 5000

ENTRYPOINT ["/app/entrypoint.sh"]
