mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-11-01 01:24:45 +03:00
feat: upgrade PostgreSQL to version 18 and update data volume path in Compose files
This commit is contained in:
@@ -34,7 +34,7 @@ jobs:
|
|||||||
ports:
|
ports:
|
||||||
- 6379:6379
|
- 6379:6379
|
||||||
sqldb:
|
sqldb:
|
||||||
image: postgres:17
|
image: postgres:18.6
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: panettone
|
POSTGRES_USER: panettone
|
||||||
POSTGRES_PASSWORD: secret
|
POSTGRES_PASSWORD: secret
|
||||||
|
|||||||
@@ -47,7 +47,9 @@
|
|||||||
|
|
||||||
## About The Project
|
## 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
|
### Built With
|
||||||
[![FastAPI][fastapi.tiangolo.com]][fastapi-url]
|
[![FastAPI][fastapi.tiangolo.com]][fastapi-url]
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ services:
|
|||||||
context: ./db
|
context: ./db
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- panettone_postgres_data:/var/lib/postgresql/data
|
- panettone_postgres_data:/var/lib/postgresql
|
||||||
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ services:
|
|||||||
context: ./db
|
context: ./db
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- panettone_postgres_data:/var/lib/postgresql/data
|
- panettone_postgres_data:/var/lib/postgresql
|
||||||
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# pull official base image
|
# pull official base image
|
||||||
FROM postgres:17.7-alpine
|
FROM postgres:18.6-alpine
|
||||||
|
|
||||||
WORKDIR /home/gx/code
|
WORKDIR /home/gx/code
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ services:
|
|||||||
context: ./db
|
context: ./db
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- fastapi_postgres_data:/var/lib/postgresql/data
|
- fastapi_postgres_data:/var/lib/postgresql
|
||||||
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
- ./db/create.sql:/docker-entrypoint-initdb.d/create.sql
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ services:
|
|||||||
context: ./db
|
context: ./db
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- fastapi_postgres_data:/var/lib/postgresql/data
|
- fastapi_postgres_data:/var/lib/postgresql
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user