- Introduced a comprehensive backend API using TypeScript, Fastify, and PostgreSQL. - Added essential files including architecture documentation, environment configuration, and Docker setup. - Implemented RESTful routes for managing assets, liabilities, clients, invoices, and cashflow. - Established a robust database schema with Prisma for data management. - Integrated middleware for authentication and error handling. - Created service and repository layers to adhere to SOLID principles and clean architecture. - Included example environment variables for development, staging, and production setups.
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Development database
|
|
db-dev:
|
|
image: postgres:16-alpine
|
|
container_name: wealth-db-dev
|
|
environment:
|
|
POSTGRES_USER: wealth
|
|
POSTGRES_PASSWORD: wealth_dev
|
|
POSTGRES_DB: wealth_dev
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_dev_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U wealth -d wealth_dev"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Staging database
|
|
db-staging:
|
|
image: postgres:16-alpine
|
|
container_name: wealth-db-staging
|
|
environment:
|
|
POSTGRES_USER: wealth
|
|
POSTGRES_PASSWORD: ${STAGING_DB_PASSWORD:-wealth_staging}
|
|
POSTGRES_DB: wealth_staging
|
|
ports:
|
|
- "5433:5432"
|
|
volumes:
|
|
- postgres_staging_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U wealth -d wealth_staging"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Production database
|
|
db-prod:
|
|
image: postgres:16-alpine
|
|
container_name: wealth-db-prod
|
|
environment:
|
|
POSTGRES_USER: wealth
|
|
POSTGRES_PASSWORD: ${PROD_DB_PASSWORD:?PROD_DB_PASSWORD is required}
|
|
POSTGRES_DB: wealth_prod
|
|
ports:
|
|
- "5434:5432"
|
|
volumes:
|
|
- postgres_prod_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U wealth -d wealth_prod"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1G
|
|
|
|
volumes:
|
|
postgres_dev_data:
|
|
postgres_staging_data:
|
|
postgres_prod_data:
|
|
|