31 lines
768 B
Docker
31 lines
768 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# System dependencies:
|
|
# openssh-client + sshpass — required by Ansible/paramiko for remote device ops
|
|
# gcc — builds paramiko's C extensions
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
openssh-client \
|
|
sshpass \
|
|
gcc \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt \
|
|
&& pip install --no-cache-dir ansible-core
|
|
|
|
COPY . .
|
|
|
|
# Runtime data directories (also mounted as volumes in compose)
|
|
RUN mkdir -p data logs
|
|
|
|
ENV FLASK_ENV=production
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PORT=5000
|
|
|
|
EXPOSE 5000
|
|
|
|
CMD ["gunicorn", "-b", "0.0.0.0:5000", "-w", "4", "--timeout", "300", "wsgi:app"]
|