From 3fa0a23b76481cea59b65d5c664ac7393bf087eb Mon Sep 17 00:00:00 2001 From: Phil Varner Date: Mon, 14 Apr 2025 21:47:28 -0400 Subject: [PATCH] fix: tweaks to docker files and rename compose --- CHANGES.md | 2 +- Dockerfile | 11 ++++++----- Dockerfile.docs | 6 ++++-- Makefile | 4 ++-- README.md | 8 ++++---- docker-compose.docs.yml => compose.docs.yml | 0 6 files changed, 17 insertions(+), 14 deletions(-) rename docker-compose.docs.yml => compose.docs.yml (100%) diff --git a/CHANGES.md b/CHANGES.md index 64b595bac..271a1ec26 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -373,7 +373,7 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha ### Added * Nginx service as second docker-compose stack to demonstrate proxy ([#503](https://github.com/stac-utils/stac-fastapi/pull/503)) -* Validation checks in CI using [stac-api-validator](github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508)) +* Validation checks in CI using [stac-api-validator](https://github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508)) * Required links to the sqlalchemy ItemCollection endpoint ([#508](https://github.com/stac-utils/stac-fastapi/pull/508)) * Publication of docker images to GHCR ([#525](https://github.com/stac-utils/stac-fastapi/pull/525)) diff --git a/Dockerfile b/Dockerfile index 9b6817182..bd0f810bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim as base +FROM python:3.12-slim AS base # Any python libraries that require system libraries to be installed will likely # need the following packages in order to build @@ -10,12 +10,13 @@ RUN apt-get update && \ ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt -FROM base as builder +FROM base AS builder WORKDIR /app COPY . /app -RUN python -m pip install -e ./stac_fastapi/types[dev] && \ - python -m pip install -e ./stac_fastapi/api[dev] && \ - python -m pip install -e ./stac_fastapi/extensions[dev] +RUN python -m pip install \ + -e ./stac_fastapi/types[dev] \ + -e ./stac_fastapi/api[dev] \ + -e ./stac_fastapi/extensions[dev] diff --git a/Dockerfile.docs b/Dockerfile.docs index b98ea65f2..6bea0805f 100644 --- a/Dockerfile.docs +++ b/Dockerfile.docs @@ -1,7 +1,9 @@ -FROM python:3.11-slim +FROM python:3.12-slim # build-essential is required to build a wheel for ciso8601 -RUN apt update && apt install -y build-essential +RUN apt update && apt install -y build-essential && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* RUN python -m pip install --upgrade pip diff --git a/Makefile b/Makefile index a835bb52a..fedc71a12 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ install: .PHONY: docs-image docs-image: - docker compose -f docker-compose.docs.yml \ + docker compose -f compose.docs.yml \ build .PHONY: docs docs: docs-image - docker compose -f docker-compose.docs.yml \ + docker compose -f compose.docs.yml \ run docs .PHONY: test diff --git a/README.md b/README.md index 19d5031bc..c18d98807 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,10 @@ Other backends may be available from other sources, search [PyPI](https://pypi.o Install the packages in editable mode: ```shell -python -m pip install -e \ - 'stac_fastapi/types[dev]' \ - 'stac_fastapi/api[dev]' \ - 'stac_fastapi/extensions[dev]' +python -m pip install \ + -e 'stac_fastapi/types[dev]' \ + -e 'stac_fastapi/api[dev]' \ + -e 'stac_fastapi/extensions[dev]' ``` To run the tests: diff --git a/docker-compose.docs.yml b/compose.docs.yml similarity index 100% rename from docker-compose.docs.yml rename to compose.docs.yml