-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.85 KB
/
docker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.85 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
services:
app:
build:
context: .
dockerfile: Dockerfile
image: veritix-python-app:latest
container_name: veritix-app
environment:
- PYTHONUNBUFFERED=1
- QR_SIGNING_KEY=${QR_SIGNING_KEY:-test_signing_key}
- DATABASE_URL=postgresql://veritix:veritix@db:5432/veritix
- ADMIN_API_KEY=${ADMIN_API_KEY:-default_admin_secret_change_me}
ports:
- "8000:8000"
command: uvicorn src.main:app --host 0.0.0.0 --port 8000
depends_on:
- db
db:
image: postgres:16-alpine
container_name: veritix-db
environment:
- POSTGRES_USER=veritix
- POSTGRES_PASSWORD=veritix
- POSTGRES_DB=veritix
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
# Prometheus monitoring (optional)
prometheus:
image: prom/prometheus:latest
container_name: veritix-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
depends_on:
- app
profiles: ["monitoring"]
volumes:
db_data:
# Prometheus Configuration Example
# Create a prometheus.yml file with the following content:
#
# global:
# scrape_interval: 15s
#
# scrape_configs:
# - job_name: 'veritix-metrics'
# scheme: http
# metrics_path: /metrics
# static_configs:
# - targets: ['app:8000']
# authorization:
# type: Bearer
# credentials: ${ADMIN_API_KEY}
#
# Usage:
# 1. Set ADMIN_API_KEY environment variable: export ADMIN_API_KEY="your-secure-admin-key"
# 2. Start with monitoring profile: docker-compose --profile monitoring up
# 3. Access Prometheus at http://localhost:9090