Skip to content

Commit

Permalink
update Dockerfile to copy only FastETL specific files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor committed Apr 25, 2023
1 parent 380baa5 commit 97e139d
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,30 @@ 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] \
apache-airflow-providers-fastetl
RUN pip install --no-cache-dir --user 'apache-airflow[microsoft.mssql,google_auth]'

# Copy and install requirements.txt
COPY requirements.txt /
Expand Down

0 comments on commit 97e139d

Please sign in to comment.