feat: add Docker support and database migrations
- Created Dockerfile for building and running the application with Uvicorn. - Added docker-compose.yml to manage application and PostgreSQL service. - Introduced Alembic migrations with initial schema for CRM domain objects. - Configured async SQLAlchemy engine for migrations. - Updated dependencies in uv.lock to include asyncpg, passlib, and pyjwt.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: app/Dockerfile
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/test_task_crm
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: test_task_crm
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user