feat: upgrade PostgreSQL to version 18 and update data volume path in Compose files

This commit is contained in:
grillazz
2026-10-22 12:22:31 +02:00
parent bf516ff320
commit d0377eb1f0
7 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
ports:
- 6379:6379
sqldb:
image: postgres:17
image: postgres:18.6
env:
POSTGRES_USER: panettone
POSTGRES_PASSWORD: secret
+3 -1
View File
@@ -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]
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -1,5 +1,5 @@
# pull official base image
FROM postgres:17.7-alpine
FROM postgres:18.6-alpine
WORKDIR /home/gx/code
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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: