Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,44 @@ RUN apt-get update \
wget \
gettext \
build-essential \
zlib1g-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libffi-dev \
binutils \
libgdal-dev \
gdal-bin \
libproj-dev \
proj-bin \
libgeos-dev \
&& rm -rf /var/lib/apt/lists/*

ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal

RUN addgroup --gid ${HOST_GID} airflow \
&& usermod -u ${HOST_UID} -g ${HOST_GID} -d /home/airflow -s /bin/bash airflow \
&& echo "airflow ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/airflow \
&& chmod 0440 /etc/sudoers.d/airflow \
&& mkdir -p /opt/airflow/envs \
&& chown -R ${HOST_UID}:${HOST_GID} ${AIRFLOW_HOME}/ /opt/airflow/

RUN wget https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tgz \
&& tar -xf Python-3.12.8.tgz \
&& cd Python-3.12.8 \
&& ./configure --enable-optimizations --with-ensurepip=install \
&& make -j$(nproc) \
&& make altinstall \
&& cd .. \
&& rm -rf Python-3.12.8 Python-3.12.8.tgz

ENV PATH "$PATH:/home/airflow/.local/bin"
ENV PATH "$PATH:/usr/bin/dirname"

COPY --chown=airflow scripts/entrypoint.sh /entrypoint.sh
COPY --chown=airflow pyproject.toml README.md ${AIRFLOW_HOME}
COPY --chown=airflow pyproject.toml README.md scripts/requirements-vegetation-metrics.txt ${AIRFLOW_HOME}/
RUN chmod +x /entrypoint.sh

USER airflow
Expand All @@ -56,6 +81,10 @@ RUN curl -sSL https://install.python-poetry.org | python3
WORKDIR ${AIRFLOW_HOME}

RUN poetry config virtualenvs.create false \
&& poetry install --no-root --only main --no-root
&& poetry install --no-root --only main

RUN python3.12 -m venv /opt/airflow/envs/geospatial_env \
&& /opt/airflow/envs/geospatial_env/bin/pip install --no-cache-dir --upgrade pip setuptools wheel \
&& /opt/airflow/envs/geospatial_env/bin/pip install --no-cache-dir -r ${AIRFLOW_HOME}/requirements-vegetation-metrics.txt

ENTRYPOINT [ "/entrypoint.sh" ]
2 changes: 1 addition & 1 deletion alertflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_version() -> str:
try:
return importlib_metadata.version(__name__)
except importlib_metadata.PackageNotFoundError: # pragma: no cover
return '2.0.0' # changed by semantic-release
return "2.0.0" # changed by semantic-release


version: str = get_version()
Expand Down
Loading
Loading