-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (96 loc) · 2.69 KB
/
docker-compose.yml
File metadata and controls
101 lines (96 loc) · 2.69 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
services:
postgres:
image: pgvector/pgvector:pg16
container_name: synapse-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-synapse}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required. Run ./setup.sh first.}
POSTGRES_DB: ${POSTGRES_DB:-synapse}
ports:
- "127.0.0.1:5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./infrastructure/docker/postgres-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-synapse}"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: synapse-redis
restart: unless-stopped
command:
- redis-server
- --appendonly
- "yes"
- --requirepass
- ${REDIS_PASSWORD:?REDIS_PASSWORD is required. Run ./setup.sh first.}
ports:
- "127.0.0.1:6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 5s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: infrastructure/Dockerfile.api
container_name: synapse-api
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-synapse}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-synapse}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required. Run ./setup.sh first.}
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:?JWT_REFRESH_SECRET is required. Run ./setup.sh first.}
AI_PROVIDER: ${AI_PROVIDER:-}
AI_ENGINE_KIND: ${AI_ENGINE_KIND:-}
AI_API_KEY: ${AI_API_KEY:-}
AI_BASE_URL: ${AI_BASE_URL:-}
AI_MODEL: ${AI_MODEL:-}
NODE_ENV: production
PORT: "3001"
HOST: "0.0.0.0"
PLATFORM_ADMIN_EMAILS: ${PLATFORM_ADMIN_EMAILS:-demo@synapse.dev}
ports:
- "127.0.0.1:3001:3001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
profiles:
- production
web:
build:
context: .
dockerfile: infrastructure/Dockerfile.web
container_name: synapse-web
environment:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
NEXT_PUBLIC_WS_URL: ${NEXT_PUBLIC_WS_URL}
ports:
- "127.0.0.1:3000:3000"
depends_on:
- api
profiles:
- production
nginx:
image: nginx:alpine
container_name: synapse-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./infrastructure/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
- web
profiles:
- production
volumes:
pgdata:
redisdata: