diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 68ca285..533f264 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -34,7 +34,7 @@ jobs: ports: - 6379:6379 sqldb: - image: postgres:17 + image: postgres:18.6 env: POSTGRES_USER: panettone POSTGRES_PASSWORD: secret diff --git a/README.md b/README.md index b49485e..8ffef2e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,9 @@ ## About The Project -This demonstration application showcases the powerful integration of [FastAPI](https://fastapi.tiangolo.com/)—a modern, high-performance web framework—with [Pydantic 2.0](https://github.com/pydantic/pydantic) for robust data validation. The backend architecture is further reinforced by leveraging the [SQLAlchemy ORM](https://www.sqlalchemy.org/) along with an asynchronous connection to a [PostgreSQL 17](https://www.postgresql.org/docs/17/release.html) relational database. High-throughput communication across the stack is achieved using the [asyncpg](https://github.com/MagicStack/asyncpg) database client library, delivering an efficient, non-blocking interface to process database transactions seamlessly within Python's asyncio event loop. +This demonstration application showcases the powerful integration of [FastAPI](https://fastapi.tiangolo.com/)—a modern, high-performance web framework—with [Pydantic 2.0](https://github.com/pydantic/pydantic) for robust data validation. The backend architecture is further reinforced by leveraging the [SQLAlchemy ORM](https://www.sqlalchemy.org/) along with an asynchronous connection to a [PostgreSQL 18](https://www.postgresql.org/docs/18/release.html) relational database. High-throughput communication across the stack is achieved using the [asyncpg](https://github.com/MagicStack/asyncpg) database client library, delivering an efficient, non-blocking interface to process database transactions seamlessly within Python's asyncio event loop. + +PostgreSQL 18 uses `/var/lib/postgresql` for its persistent data volume. Existing PostgreSQL 17 data must be migrated with `pg_upgrade` or a dump and restore before using the updated Compose configurations. ### Built With [![FastAPI][fastapi.tiangolo.com]][fastapi-url] diff --git a/compose-ha.yml b/compose-ha.yml index 36a2a78..25946a3 100644 --- a/compose-ha.yml +++ b/compose-ha.yml @@ -54,7 +54,7 @@ services: context: ./db dockerfile: Dockerfile volumes: - - panettone_postgres_data:/var/lib/postgresql/data + - panettone_postgres_data:/var/lib/postgresql - ./db/create.sql:/docker-entrypoint-initdb.d/create.sql env_file: - .env diff --git a/compose.yml b/compose.yml index 9e5c5cb..885ddf4 100644 --- a/compose.yml +++ b/compose.yml @@ -31,7 +31,7 @@ services: context: ./db dockerfile: Dockerfile volumes: - - panettone_postgres_data:/var/lib/postgresql/data + - panettone_postgres_data:/var/lib/postgresql - ./db/create.sql:/docker-entrypoint-initdb.d/create.sql env_file: - .env diff --git a/db/Dockerfile b/db/Dockerfile index 7b2ae09..24544cf 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -1,5 +1,5 @@ # pull official base image -FROM postgres:17.7-alpine +FROM postgres:18.6-alpine WORKDIR /home/gx/code diff --git a/granian-compose.yml b/granian-compose.yml index 9e71292..1e08a0e 100644 --- a/granian-compose.yml +++ b/granian-compose.yml @@ -30,7 +30,7 @@ services: context: ./db dockerfile: Dockerfile volumes: - - fastapi_postgres_data:/var/lib/postgresql/data + - fastapi_postgres_data:/var/lib/postgresql - ./db/create.sql:/docker-entrypoint-initdb.d/create.sql env_file: - .env diff --git a/valkey-compose.yml b/valkey-compose.yml index 0ee4f6b..f67030f 100644 --- a/valkey-compose.yml +++ b/valkey-compose.yml @@ -24,7 +24,7 @@ services: context: ./db dockerfile: Dockerfile volumes: - - fastapi_postgres_data:/var/lib/postgresql/data + - fastapi_postgres_data:/var/lib/postgresql env_file: - .env ports: