forked from gestaogovbr/Ro-dou
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
35 lines (26 loc) · 1.14 KB
/
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
32
33
34
35
FROM apache/airflow:2.5.1
USER root
# Copy Ro-dou core files from the host Docker context
COPY src /opt/airflow/dags/ro_dou
# Install Git
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
# Clone the FastETL GitHub repository and copy specified files
RUN git clone https://github.com/economiagovbr/FastETL.git /tmp/repo-FastETL && \
mkdir -p /opt/airflow/plugins/FastETL/hooks && \
mkdir -p /opt/airflow/plugins/FastETL/custom_functions/utils && \
cp /tmp/repo-FastETL/fastetl/hooks/dou_hook.py /opt/airflow/plugins/FastETL/hooks/ && \
cp -r /tmp/repo-FastETL/fastetl/custom_functions/utils/date.py /opt/airflow/plugins/FastETL/custom_functions/utils/
# Remove Git and clean up package cache
RUN apt-get remove -y git && \
apt-get autoremove -yqq --purge && \
apt-get clean && \
rm -rf /tmp/repo-FastETL
RUN chown -R airflow /opt/airflow
USER airflow
# Install additional Airflow dependencies
RUN pip install --no-cache-dir --user 'apache-airflow[microsoft.mssql,google_auth]'
# Copy and install requirements.txt
COPY requirements.txt /
RUN pip install --no-cache-dir -r /requirements.txt