diff --git a/.dockerignore b/.dockerignore index a1238d0..1b0d3fd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,8 +3,11 @@ **/*.egg-info **/__pycache__ **/cdk.out -**/.venv +**/*.egg-info +packages/stac-index/tests + +**/.venv **/.env **/.idea **/.vscode diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile index 3ec63bd..41f1d6f 100644 --- a/docker/api/Dockerfile +++ b/docker/api/Dockerfile @@ -15,21 +15,18 @@ ENV UV_LINK_MODE=copy \ ### End build prep -- this is where your app Dockerfile should start. WORKDIR /src -COPY ./ /src +COPY pyproject.toml . +COPY uv.lock . +# File is required to successfully parse root package.toml, even though not installed. +COPY packages/stac-index/pyproject.toml ./packages/stac-index/ -RUN uv sync \ - --directory=/src \ - --locked \ - --no-dev \ - --no-install-project - +# Install dependencies. RUN uv sync \ --extra server \ --locked \ --no-dev \ - --no-editable - + --no-install-workspace # ########################################################################## diff --git a/docker/indexer/Dockerfile b/docker/indexer/Dockerfile index bfc9110..07f79d0 100644 --- a/docker/indexer/Dockerfile +++ b/docker/indexer/Dockerfile @@ -13,19 +13,26 @@ ENV UV_LINK_MODE=copy \ UV_PROJECT_ENVIRONMENT=/opt/app ### End build prep -- this is where your app Dockerfile should start. -COPY ./ /src + WORKDIR /src +COPY pyproject.toml . +COPY uv.lock . + +# Files are required to successfully parse package.toml, even though the project is not installed at this stage. +COPY packages/stac-index/pyproject.toml ./packages/stac-index/ +COPY packages/stac-index/README.md ./packages/stac-index/ +# Install dependencies first, then application code, as dependencies change less frequently. RUN uv sync \ --package=stac-index \ - --directory=/src \ --locked \ --no-dev \ --no-install-project +# Copy and install application code. +COPY packages/stac-index/* ./packages/stac-index/ RUN uv sync \ --package=stac-index \ - --directory=/src \ --locked \ --no-dev \ --no-editable diff --git a/iac/api/Dockerfile b/iac/api/Dockerfile index 4592211..c57c097 100644 --- a/iac/api/Dockerfile +++ b/iac/api/Dockerfile @@ -15,21 +15,18 @@ ENV UV_LINK_MODE=copy \ ### End build prep -- this is where your app Dockerfile should start. WORKDIR /src -COPY ./ /src +COPY pyproject.toml . +COPY uv.lock . +# File is required to successfully parse root package.toml, even though not installed. +COPY packages/stac-index/pyproject.toml ./packages/stac-index/ -RUN uv sync \ - --directory=/src \ - --locked \ - --no-dev \ - --no-install-project - +# Install dependencies. RUN uv sync \ --extra lambda \ --locked \ --no-dev \ - --no-editable - + --no-install-workspace # ########################################################################## diff --git a/iac/indexer/Dockerfile b/iac/indexer/Dockerfile index be66b7c..50c5b50 100644 --- a/iac/indexer/Dockerfile +++ b/iac/indexer/Dockerfile @@ -13,19 +13,26 @@ ENV UV_LINK_MODE=copy \ UV_PROJECT_ENVIRONMENT=/opt/app ### End build prep -- this is where your app Dockerfile should start. -COPY ./ /src + WORKDIR /src +COPY pyproject.toml . +COPY uv.lock . + +# Files are required to successfully parse package.toml, even though the project is not installed at this stage. +COPY packages/stac-index/pyproject.toml ./packages/stac-index/ +COPY packages/stac-index/README.md ./packages/stac-index/ +# Install dependencies first, then application code, as dependencies change less frequently. RUN uv sync \ --package=stac-index \ - --directory=/src \ --locked \ --no-dev \ --no-install-project +# Copy and install application code. +COPY packages/stac-index/* ./packages/stac-index/ RUN uv sync \ --package=stac-index \ - --directory=/src \ --locked \ --no-dev \ --no-editable