Files
2026-03-27 10:20:35 +01:00

29 lines
723 B
Docker

FROM python:3.12-slim
LABEL maintainer="DragonBank Team"
LABEL description="DragonBank Interest Calculator Service"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY app.py .
RUN adduser --disabled-password --gecos '' appuser && \
chown -R appuser:appuser /app
USER appuser
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD python -c "import psycopg2; psycopg2.connect('${DATABASE_URL}')" || exit 1
CMD ["python", "app.py"]