-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (119 loc) · 2.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
126 lines (119 loc) · 2.84 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.8'
services:
# ================================
# FlairAi Backend API
# ================================
api:
build:
context: .
dockerfile: backend/Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
- FRONTEND_URL=http://localhost:5173
env_file:
- .env
volumes:
- ./backend/src:/app/backend/src
- ./backend/logs:/app/logs
- ./uploads:/app/uploads
depends_on:
- postgres
- redis
networks:
- flaire-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
# ================================
# Frontend Development Server
# ================================
frontend:
build:
context: .
dockerfile: docker/Dockerfile.frontend
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:3000
env_file:
- .env
volumes:
- ./src-business:/app/src-business
- ./components:/app/components
- ./lib:/app/lib
- ./contexts:/app/contexts
- ./hooks:/app/hooks
networks:
- flaire-network
restart: unless-stopped
# ================================
# PostgreSQL Database (for local development)
# ================================
postgres:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: flaire_ai
POSTGRES_USER: flaire_user
POSTGRES_PASSWORD: flaire_password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
- ./database/seeds:/docker-entrypoint-initdb.d/seeds
networks:
- flaire-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U flaire_user -d flaire_ai"]
interval: 30s
timeout: 10s
retries: 3
# ================================
# Redis (for caching and sessions)
# ================================
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- flaire-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# ================================
# Nginx (for local SSL and routing)
# ================================
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/nginx.conf:/etc/nginx/nginx.conf
- ./docker/ssl:/etc/nginx/ssl
depends_on:
- api
- frontend
networks:
- flaire-network
restart: unless-stopped
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
flaire-network:
driver: bridge