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
37 changes: 37 additions & 0 deletions de-projects/26_airflow_docker_databricks_etl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Airflow 3.0.3, Python 3.12
FROM apache/airflow:3.0.3-python3.12

USER root

# uv just for building wheel
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
&& ln -s /root/.local/bin/uv /usr/local/bin/uv

# Put code in place
ENV PYTHONPATH=/opt/python:${PYTHONPATH}
COPY ./scripts /opt/python/scripts/
COPY ./airflow ${AIRFLOW_HOME}/

# Build & install wheel
WORKDIR /tmp/src
COPY . /tmp/src
RUN if [ -f pyproject.toml ]; then \
uv build && python -m pip install --no-cache-dir dist/*.whl ; \
else \
echo "No pyproject.toml found; skipping wheel build."; \
fi \
&& rm -rf /tmp/src

# Install runtime deps into the Airflow interpreter
RUN python -m pip install --no-cache-dir \
databricks-connect==16.3.2 \
munch==4.0.0 \
apache-airflow-providers-databricks

# permissions
RUN chown -R airflow:0 ${AIRFLOW_HOME} /opt/python && chmod -R g=u ${AIRFLOW_HOME} /opt/python

USER airflow
WORKDIR ${AIRFLOW_HOME}
Empty file.
Loading
Loading