1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92# Equalify Reflow - Infrastructure Services
#
# Architecture: Monolith with Background Workers
# - Single Python application runs FastAPI + background worker threads
# - Redis provides task queues for async background processing
# - Floci provides S3 for local development (see docker-compose.dev.yml)
#
# Usage:
# Development: docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# CI: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d
#
services:
# API Gateway - FastAPI monolith application
# Runs API endpoints and background workers in single process
api-gateway:
build:
context: .
dockerfile: Dockerfile
target: production # Default to production stage
container_name: equalify-reflow-api-gateway
restart: unless-stopped
ports:
- "8080:8080"
env_file:
- .env
environment:
- REDIS_URL=redis://redis:6379
# AWS endpoints configured per-environment:
# - Development: docker-compose.dev.yml adds Floci endpoints
# - Production: Uses real AWS (no endpoint overrides needed)
depends_on:
redis:
condition: service_healthy
networks:
- equalify-network
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health').read()"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Redis - Task queue and caching layer
# Provides async communication between FastAPI endpoints and background workers
redis:
image: redis:7-alpine
container_name: equalify-reflow-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
- ./infrastructure/redis/redis.conf:/usr/local/etc/redis/redis.conf:ro
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- equalify-network
# VeraPDF - PDF/UA-1 accessibility validation
# Provides deterministic pre-analysis for PDF accessibility issues
# verapdf:
# image: verapdf/rest:latest
# container_name: equalify-reflow-verapdf
# restart: unless-stopped
# ports:
# - "8081:8080"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8080/api/info"]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 60s
# deploy:
# resources:
# limits:
# memory: 2G
# networks:
# - equalify-network
networks:
equalify-network:
name: equalify-reflow-network
driver: bridge
volumes:
redis-data:
name: equalify-reflow-redis-data