-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (79 loc) · 2.02 KB
/
docker-compose.yml
File metadata and controls
84 lines (79 loc) · 2.02 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
# Docker Compose for Crittr Backend
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: crittr-postgres
environment:
POSTGRES_DB: crittr
POSTGRES_USER: crittr_user
POSTGRES_PASSWORD: crittr_password
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
networks:
- crittr-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U crittr_user -d crittr"]
interval: 10s
timeout: 5s
retries: 5
# FastAPI Backend
backend:
build:
context: .
dockerfile: Dockerfile
container_name: crittr-backend
environment:
DATABASE_URL: postgresql://crittr_user:crittr_password@postgres:5432/crittr
SECRET_KEY: your-super-secret-key-change-in-production
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 30
SMTP_HOST: smtp.gmail.com
SMTP_PORT: 587
SMTP_USERNAME: your-email@gmail.com
SMTP_PASSWORD: your-app-password
SMTP_FROM_EMAIL: noreply@crittr.app
OPENAI_API_KEY: ${OPENAI_API_KEY}
FRONTEND_URL: http://localhost:3000
ENVIRONMENT: development
ports:
- "8000:8000"
networks:
- crittr-network
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
volumes:
- ./logs:/app/logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# Redis for caching and sessions (optional)
redis:
image: redis:7-alpine
container_name: crittr-redis
ports:
- "6379:6379"
networks:
- crittr-network
restart: unless-stopped
volumes:
- redis_data:/data
command: redis-server --appendonly yes
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
crittr-network:
driver: bridge