-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (23 loc) · 1011 Bytes
/
Dockerfile
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
FROM apache/airflow:2.7.1
USER root
# Install PostgreSQL client and Grafana dependencies
RUN apt-get update && apt-get install -y postgresql-client \
apt-transport-https \
software-properties-common \
wget \
gnupg2
# Create airflow the logs directory and set correct permissions
RUN mkdir -p /opt/airflow/logs /opt/airflow/dags /opt/airflow/plugins \
&& chown -R airflow:root /opt/airflow \
&& chmod -R g+w /opt/airflow
# Add Grafana GPG key and repository
RUN wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
RUN echo "deb https://packages.grafana.com/oss/deb stable main" | tee -a /etc/apt/sources.list.d/grafana.list
# Install Grafana
RUN apt-get update && apt-get install -y grafana
USER airflow
# Install additional Python packages
COPY requirements.txt /requirements.txt
RUN pip install --user --no-cache-dir -r /requirements.txt
# Copy DAG file to airflow home directory
COPY dags/user_operations_analysis.py /opt/airflow/dags/user_operations_analysis.py