-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (87 loc) · 2.26 KB
/
docker-compose.yml
File metadata and controls
95 lines (87 loc) · 2.26 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
version: '3.8'
# 🚀 ADVANCED VERSION - for learning/future development
# For demo use: docker-compose.minimal.yml
# This version shows potential scaling (PostgreSQL, Redis, Grafana)
# Currently not needed for basic testing
services:
# API Server - główna aplikacja
ems-api:
build: .
container_name: ems-api-server
ports:
- "8000:8000"
environment:
- PYTHONPATH=/app
- ENV=production
restart: unless-stopped
networks:
- ems-network
volumes:
# Mount dla logów (opcjonalnie)
- ./logs:/app/logs
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/docs', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Device Simulator - symulator urządzeń IoT
ems-simulator:
build: .
container_name: ems-device-simulator
command: python device_sim.py
environment:
- PYTHONPATH=/app
- API_BASE_URL=http://ems-api:8000
depends_on:
ems-api:
condition: service_healthy
restart: unless-stopped
networks:
- ems-network
# Redis - dla cache i session storage (opcjonalne rozszerzenie)
redis:
image: redis:7-alpine
container_name: ems-redis
restart: unless-stopped
networks:
- ems-network
volumes:
- redis-data:/data
command: redis-server --appendonly yes
# PostgreSQL - dla trwałego storage (opcjonalne rozszerzenie)
postgres:
image: postgres:15-alpine
container_name: ems-postgres
environment:
POSTGRES_DB: ems_db
POSTGRES_USER: ems_user
POSTGRES_PASSWORD: ems_password
ports:
- "5432:5432"
restart: unless-stopped
networks:
- ems-network
volumes:
- postgres-data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
# Grafana - dashboard dla monitoringu (opcjonalnie)
grafana:
image: grafana/grafana:latest
container_name: ems-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin123
restart: unless-stopped
networks:
- ems-network
volumes:
- grafana-data:/var/lib/grafana
networks:
ems-network:
driver: bridge
volumes:
redis-data:
postgres-data:
grafana-data: