-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (98 loc) · 3 KB
/
docker-compose.yml
File metadata and controls
105 lines (98 loc) · 3 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:7.0
container_name: topicsflow-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: TopicsFlow
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- ./scripts/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
networks:
- topicsflow-network
# Redis (for session storage and caching)
# Configured to match Azure Redis Cache approach with password authentication
redis:
image: redis:7.2-alpine
container_name: topicsflow-redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD:-redis_password_change_in_production}
ports:
- "6379:6379"
volumes:
- redis_data:/data
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis_password_change_in_production}
networks:
- topicsflow-network
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD:-redis_password_change_in_production}", "ping"]
interval: 10s
timeout: 3s
retries: 3
# Backend API
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: topicsflow-backend
restart: unless-stopped
environment:
FLASK_ENV: development
SECRET_KEY: your-super-secret-key-change-in-production
DATABASE_URL: mongodb://admin:password123@mongodb:27017/TopicsFlow?authSource=admin
DB_NAME: TopicsFlow
FRONTEND_URL: http://localhost:3000
TOTP_ISSUER: TopicsFlow
# Redis configuration - matches Azure Redis Cache approach
# Format: redis://password@host:port/0 (Docker) or host:port,password=...,ssl=True (Azure)
REDIS_URL: redis://:${REDIS_PASSWORD:-redis_password_change_in_production}@redis:6379/0
SESSION_TYPE: redis
# Enable Redis caching in Docker (same as Azure)
# Note: Local development (without Docker) uses filesystem sessions and direct DB queries
# Docker environment - enable Redis caching
ENVIRONMENT: production
# External API keys (add your own)
SMS_SERVICE_API_KEY: ${SMS_SERVICE_API_KEY:-}
EMAIL_SERVICE_API_KEY: ${EMAIL_SERVICE_API_KEY:-}
TENOR_API_KEY: ${TENOR_API_KEY:-}
ports:
- "5000:5000"
volumes:
- ./backend:/app
- totp_keys:/app/keys
depends_on:
- mongodb
- redis
networks:
- topicsflow-network
# Frontend
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: topicsflow-frontend
restart: unless-stopped
environment:
NEXT_PUBLIC_API_URL: http://localhost:5000
NEXT_PUBLIC_APP_NAME: TopicsFlow
NEXT_PUBLIC_TENOR_API_KEY: ${TENOR_API_KEY:-}
ports:
- "3000:3000"
depends_on:
- backend
networks:
- topicsflow-network
volumes:
mongodb_data:
redis_data:
totp_keys:
networks:
topicsflow-network:
driver: bridge