mirror of
https://github.com/wowlikon/LibraryAPI.git
synced 2025-12-11 21:30:46 +00:00
Global refactoring of the project to use poetry and implement tests,
fixing bugs, changing the handling of dto and db models, preparing to add new functionality
This commit is contained in:
@@ -1,33 +1,30 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
container_name: db_library
|
||||
image: postgres
|
||||
expose:
|
||||
- 5432
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./data/db:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- ./.env
|
||||
|
||||
api:
|
||||
container_name: api_library
|
||||
build: .
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||
command: bash -c "alembic upgrade head && uvicorn library_service.main:app --reload --host 0.0.0.0 --port 8000"
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./src/app/migrations/versions:/code/app/migrations/versions
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
test:
|
||||
tests:
|
||||
container_name: tests
|
||||
build: .
|
||||
command: pytest
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||
command: bash -c "pytest tests/test_misc.py"
|
||||
volumes:
|
||||
- .:/code
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user