forked from scanopy/scanopy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
171 lines (163 loc) · 4.55 KB
/
docker-compose.test.yml
File metadata and controls
171 lines (163 loc) · 4.55 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: scanopy
services:
postgres-dev:
image: postgres:17-alpine
environment:
POSTGRES_DB: scanopy
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5435:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
scanopy-dev:
ipv4_address: 172.25.0.6
ui-builder:
build:
context: ./ui
dockerfile: Dockerfile.dev
command: sh -c "npm run build && cp -r build/* /output/"
volumes:
- ./messages:/messages:ro
- ui-build:/output
server:
build:
context: ./backend
dockerfile: Dockerfile.dev
command: sh -c "cargo run --bin server --features generate-fixtures"
ports:
- "60072:60072"
environment:
- RUST_LOG=debug,sqlx=off,tower_http=off
- SCANOPY_PUBLIC_URL=http://localhost:60072
- SCANOPY_DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-password}@postgres-dev:5432/scanopy
- SCANOPY_WEB_EXTERNAL_PATH=/app/static
- SCANOPY_LOG_LEVEL=debug
- SCANOPY_INTEGRATED_DAEMON_URL=http://daemon:60073
- SCANOPY_ENFORCE_BILLING_FOR_TESTING=true
volumes:
- ./backend:/app
- data-volume:/data
- ui-build:/app/static:ro
- cargo-cache:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- rust-target:/app/target
depends_on:
ui-builder:
condition: service_completed_successfully
postgres-dev:
condition: service_healthy
daemon:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:60072/api/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 600s
networks:
scanopy-dev:
ipv4_address: 172.25.0.3
daemon:
build:
context: ./backend
dockerfile: Dockerfile.dev
privileged: true
restart: unless-stopped
environment:
- SCANOPY_SERVER_URL=http://server:60072
- SCANOPY_DAEMON_PORT=60073
- SCANOPY_BIND_ADDRESS=0.0.0.0
- SCANOPY_NAME=scanopy-daemon
- SCANOPY_MODE=daemon_poll
- SCANOPY_LOG_LEVEL=debug
- SCANOPY_HEARTBEAT_INTERVAL=30
volumes:
- ./backend:/app
- ./data/daemon_config:/root/.config/scanopy/daemon
- cargo-cache:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- rust-target:/app/target
command: sh -c "cargo run --bin daemon --features generate-fixtures"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:60073/api/health || exit 1"]
interval: 5s
timeout: 3s
retries: 15
start_period: 600s
networks:
scanopy-dev:
ipv4_address: 172.25.0.4
daemon-serverpoll:
build:
context: ./backend
dockerfile: Dockerfile.dev
privileged: true
restart: unless-stopped
environment:
- SCANOPY_SERVER_URL=http://server:60072
- SCANOPY_MODE=server_poll
- SCANOPY_DAEMON_PORT=60074
- SCANOPY_BIND_ADDRESS=0.0.0.0
- SCANOPY_NAME=scanopy-daemon-serverpoll
- SCANOPY_LOG_LEVEL=debug
volumes:
- ./backend:/app
- ./data/daemon_serverpoll_config:/root/.config/scanopy/daemon
- cargo-cache:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- rust-target:/app/target
command: sh -c "cargo run --bin daemon --features generate-fixtures"
# Wait for daemon to be healthy first - they share the same cargo target
# directory, so compiling sequentially avoids lock contention
depends_on:
daemon:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:60074/api/health || exit 1"]
interval: 5s
timeout: 3s
retries: 15
start_period: 600s
ports:
- "60074:60074"
networks:
scanopy-dev:
ipv4_address: 172.25.0.7
homeassistant:
image: lscr.io/linuxserver/homeassistant:latest
container_name: homeassistant-discovery
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- homeassistant-config:/config
ports:
- 8123:8123
restart: unless-stopped
networks:
scanopy-dev:
ipv4_address: 172.25.0.5
volumes:
ui-build:
cargo-cache:
cargo-git:
rust-target:
data-volume:
daemon-config-volume:
postgres_data:
homeassistant-config:
networks:
scanopy-dev:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/28
gateway: 172.25.0.1