-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
76 lines (72 loc) · 2.25 KB
/
docker-compose.yaml
File metadata and controls
76 lines (72 loc) · 2.25 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
services:
# Go CMS API Server (Wahb CMS)
server:
build:
context: .
dockerfile: Dockerfile
container_name: wahb-cms
ports:
- "8080:8080"
environment:
# Use ENV from .env file, default to development for local docker usage
- ENV=${ENV:-development}
# DATABASE_URL from .env file - REQUIRED for production deployments
# For local development with docker-compose db, use: postgres://postgres:postgres@db:5432/wahb_db?sslmode=disable
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:postgres@db:5432/wahb_db?sslmode=disable}
- JWT_SECRET=${JWT_SECRET:-dev_jwt_secret_change_me}
- JWT_EXPIRATION_HOURS=${JWT_EXPIRATION_HOURS:-24}
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-ChangeMe123!}
- ADMIN_ROLE=${ADMIN_ROLE:-admin}
- CMS_SERVICE_TOKEN=${CMS_SERVICE_TOKEN:-123}
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- wahb-network
# PostgreSQL with pgvector extension (required for Wahb embeddings)
db:
image: ankane/pgvector:latest
container_name: wahb-db
environment:
# Extract credentials from DATABASE_URL or use defaults
# Format: postgres://USER:PASSWORD@HOST:PORT/DATABASE
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-wahb_db}
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./src/migrations/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-wahb_db}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- wahb-network
# Redis for caching (optional, for future use)
redis:
image: redis:7-alpine
container_name: wahb-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- wahb-network
networks:
wahb-network:
driver: bridge
volumes:
postgres_data:
redis_data: