# Dockerfile
FROM        086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python313 AS base
WORKDIR     /var/app

COPY        --from=ghcr.io/astral-sh/uv:0.7.3 /uv /uvx /bin/
COPY        pyproject.toml uv.lock ./
RUN         touch README.md # README must exist for uv to work
RUN         uv sync --all-extras --no-dev

COPY        ./airflow_tools ./airflow_tools

USER        worker
ENTRYPOINT  ["uv", "run", "--no-dev", "airflow_tools"]
CMD         ["--help"]

#################################
### Build image for unit-lint ###
#################################
FROM        base AS unit-lint

RUN         uv sync --dev

COPY        ./tests ./tests
COPY        ./scripts/unit-lint.sh ./scripts/unit-lint.sh

ENTRYPOINT  ["scripts/unit-lint.sh"]
