-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
106 lines (95 loc) · 2.61 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
106 lines (95 loc) · 2.61 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
106
version: '3.9'
services:
systemd-monitor:
build:
context: .
dockerfile: Dockerfile
container_name: systemd-monitor-dev
restart: unless-stopped
# Development ports and settings
ports:
- "5001:5001"
- "5678:5678" # Debug port
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://0.0.0.0:5001
- DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
- DOTNET_USE_POLLING_FILE_WATCHER=1
- DOTNET_WATCH=1
# Development volume mounts for hot reload
volumes:
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
- /var/log/journal:/var/log/journal:ro
- /sys:/sys:ro
- /proc:/proc:ro
- ./logs:/app/logs
- ./appsettings.Development.json:/app/appsettings.Development.json:ro
- ./appsettings.json:/app/appsettings.json:ro
- .:/src
- ~/.nuget/packages:/root/.nuget/packages
# Keep container running for development
command: ["dotnet", "watch", "run", "--no-restore", "--project", "/src/systemd-service-monitor.csproj", "--urls", "https://0.0.0.0:5001"]
# Security configuration
privileged: true
cap_add:
- SYS_ADMIN
- SYS_PTRACE
healthcheck:
test: ["CMD", "curl", "-f", "-k", "https://localhost:5001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
# Optional PostgreSQL for development
postgres:
image: postgres:16-alpine
container_name: systemd-monitor-db-dev
restart: unless-stopped
environment:
POSTGRES_DB: systemd_monitor
POSTGRES_USER: systemd_monitor
POSTGRES_PASSWORD: dev_password
POSTGRES_INITDB_ARGS: --encoding=UTF8 --locale=en_US.UTF-8
volumes:
- postgres-data-dev:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U systemd_monitor"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Optional Redis for development
redis:
image: redis:7-alpine
container_name: systemd-monitor-redis-dev
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data-dev:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
postgres-data-dev:
driver: local
redis-data-dev:
driver: local