-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (98 loc) · 2.52 KB
/
docker-compose.yml
File metadata and controls
104 lines (98 loc) · 2.52 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
version: '3.8'
services:
# PostgreSQL database
postgres:
image: postgres:15-alpine
container_name: plainview-postgres
environment:
POSTGRES_USER: plainview
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-plainview_password}
POSTGRES_DB: plainview
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U plainview"]
interval: 10s
timeout: 5s
retries: 5
networks:
- plainview
# Redis for caching and pub/sub
redis:
image: redis:7-alpine
container_name: plainview-redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- plainview
# FastAPI backend
api:
build:
context: ./services/api
dockerfile: Dockerfile
container_name: plainview-api
environment:
ENVIRONMENT: ${ENVIRONMENT:-development}
PORT: 4000
POSTGRES_URL: postgresql+asyncpg://plainview:${POSTGRES_PASSWORD:-plainview_password}@postgres:5432/plainview
REDIS_URL: redis://redis:6379
API_KEY_ENABLED: ${API_KEY_ENABLED:-false}
API_KEYS: ${API_KEYS:-}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5173,http://localhost:3000}
SUMMIT_ENABLED: ${SUMMIT_ENABLED:-false}
SUMMIT_MQTT_URL: ${SUMMIT_MQTT_URL:-}
SUMMIT_API_KEY: ${SUMMIT_API_KEY:-}
SUMMIT_ORG_ID: ${SUMMIT_ORG_ID:-}
volumes:
- ./services/api:/app
- ./services/api/data:/app/data
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- plainview
restart: unless-stopped
# React dashboard (optional - for production, build and serve statically)
dashboard:
build:
context: ./apps/dashboard
dockerfile: Dockerfile
container_name: plainview-dashboard
environment:
VITE_API_BASE: ${VITE_API_BASE:-http://localhost:4000}
ports:
- "5173:5173"
volumes:
- ./apps/dashboard:/app
- /app/node_modules
depends_on:
- api
networks:
- plainview
restart: unless-stopped
volumes:
postgres_data:
redis_data:
networks:
plainview:
driver: bridge