Skip to content

Commit

Permalink
oopsy
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienheureux committed Feb 20, 2025
1 parent 6b88174 commit e83aa79
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
46 changes: 15 additions & 31 deletions airflow-scheduler.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Builder gdal
# --- --- --- ---
FROM apache/airflow:2.10.4 AS builder
USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gdal-bin libgdal-dev

# install aws
WORKDIR /opt/
RUN apt-get update
RUN apt-get install unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip


# Builder python
# --- --- --- ---
FROM apache/airflow:2.10.4 AS python-builder
Expand All @@ -39,29 +22,30 @@ RUN poetry sync --with airflow
# --- --- --- ---
FROM apache/airflow:2.10.4 AS scheduler

# install AWS
# TODO: could be moved to the builder at some point.
USER root
WORKDIR /opt/aws
COPY --from=builder /opt/aws/ .
RUN ./install
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gdal-bin libgdal-dev

USER ${AIRFLOW_UID:-50000}:0
WORKDIR /opt/airflow
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal \
C_INCLUDE_PATH=/usr/include/gdal \
VIRTUAL_ENV=/home/airflow/.local \
ENV VIRTUAL_ENV=/home/airflow/.local \
LD_LIBRARY_PATH=/usr/lib \
PATH="/opt/airflow/.venv/bin:$PATH"

COPY --from=python-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY --from=builder ${CPLUS_INCLUDE_PATH} ${CPLUS_INCLUDE_PATH}


# Nécessaire pour faire fonctionner Django dans Airflow
COPY core qfdmo qfdmd dsfr_hacks data ./

# Copy airflow directories
COPY dags config plugins ./
COPY ./core/ /opt/airflow/core/
COPY ./qfdmo/ /opt/airflow/qfdmo/
COPY ./qfdmd/ /opt/airflow/qfdmd/
COPY ./data/ /opt/airflow/data/
COPY ./dsfr_hacks/ /opt/airflow/dsfr_hacks/

# Classique Airflow
COPY ./dags/ /opt/airflow/dags/
COPY ./config/ /opt/airflow/config/
COPY ./plugins/ /opt/airflow/plugins/
RUN mkdir -p /opt/airflow/logs/

CMD ["scheduler"]
2 changes: 1 addition & 1 deletion airflow-webserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ENV VIRTUAL_ENV=/home/airflow/.local \
COPY --from=python-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

WORKDIR /opt/airflow
COPY ./dags .
COPY ./dags /opt/airflow/dags

EXPOSE 8080

Expand Down

0 comments on commit e83aa79

Please sign in to comment.