-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.monitor
More file actions
42 lines (34 loc) · 1.56 KB
/
Copy pathDockerfile.monitor
File metadata and controls
42 lines (34 loc) · 1.56 KB
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
41
42
# Dockerfile.monitor
FROM python:3.10-slim
# ------------------------------------------------------------------
# System dependencies
# ------------------------------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
procps \
&& rm -rf /var/lib/apt/lists/*
# ------------------------------------------------------------------
# Create airflow user + dirs (match Airflow container conventions)
# ------------------------------------------------------------------
RUN useradd -ms /bin/bash airflow && \
mkdir -p /opt/airflow/logs /opt/airflow/artifacts /opt/airflow/tmp && \
chown -R airflow:airflow /opt/airflow
WORKDIR /opt/airflow
# ------------------------------------------------------------------
# Python dependencies
# ------------------------------------------------------------------
COPY requirements-monitoring.txt .
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements-monitoring.txt
# ------------------------------------------------------------------
# Copy monitoring source code
# ------------------------------------------------------------------
COPY src/ src/
# ------------------------------------------------------------------
# Runtime user
# ------------------------------------------------------------------
USER airflow
# ------------------------------------------------------------------
# Default command
# ------------------------------------------------------------------
CMD ["python", "src/monitor_predictions.py"]