-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
165 lines (156 loc) · 4.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
165 lines (156 loc) · 4.83 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
name: splintercom
networks:
splintercom:
driver: bridge
volumes:
pgdata:
client_tokens:
client_tokens_android:
device_oauth_config:
services:
postgres_db:
image: postgres:15
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- splintercom
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 5s
timeout: 3s
retries: 10
backend:
build:
context: ./APIServer
dockerfile: Dockerfile.dev
ports:
- "8000:8000"
env_file:
- .env
environment:
- AWS_ACCESS_KEY_ID=${aws_access_key_id}
- AWS_SECRET_ACCESS_KEY=${aws_secret_access_key}
- DJANGO_DEBUG=True
- HONEYCOMB_API_KEY=${HONEYCOMB_API_KEY}
depends_on:
postgres_db:
condition: service_healthy
networks:
- splintercom
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://0.0.0.0:8000/api/v1/health/ || exit 1"]
interval: 10s
timeout: 5s
retries: 10
utility:
build:
context: ./APIServer
dockerfile: Dockerfile.dev
command: ["sh", "utility.sh"]
env_file:
- .env
environment:
- AWS_ACCESS_KEY_ID=${aws_access_key_id}
- AWS_SECRET_ACCESS_KEY=${aws_secret_access_key}
depends_on:
backend:
condition: service_healthy
volumes:
- device_oauth_config:/root/.config/splintercom-api
- client_tokens:/root/.config/splintercomclient
- client_tokens_android:/root/.config/splintercomclient-android
networks:
- splintercom
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/utility-ready"]
interval: 5s
timeout: 3s
retries: 30
frontend:
build:
context: ./Frontend
dockerfile: Dockerfile.dev
ports:
- "8080:8080"
environment:
- VITE_APP_VERSION=${APP_VERSION:-0.0.0-dev}
- VITE_HONEYCOMB_API_KEY=${VITE_HONEYCOMB_API_KEY}
depends_on:
backend:
condition: service_healthy
networks:
- splintercom
clientpython:
build:
context: ./ClientPython
dockerfile: Dockerfile.dev
env_file:
- .env
environment:
- HTTP_API_BASE_URL=http://backend:8000
- WEBSOCKET_API_BASE_URL=ws://backend:8000
- HONEYCOMB_API_KEY=${HONEYCOMB_API_KEY}
depends_on:
utility:
condition: service_healthy
devices:
- /dev/video0:/dev/video0
volumes:
- client_tokens:/root/.config/splintercomclient
- device_oauth_config:/root/.config/splintercom-api
networks:
- splintercom
# Android emulator running ClientAndroid. GPU mode is pinned to `lavapipe` (Mesa's software
# Vulkan/GL) rather than the image's default `swiftshader_indirect` — on at least one dev
# machine, swiftshader's RenderThread reliably segfaults the emulator process a few seconds
# after boot (confirmed via journalctl: SIGSEGV, not an OOM/resource issue), while lavapipe boots
# cleanly. If boots are flaky on your machine, this is the first thing to revisit.
clientandroid-emulator:
image: budtmo/docker-android:emulator_11.0
environment:
- EMULATOR_DEVICE=Nexus 5
- WEB_VNC=true
- EMULATOR_ADDITIONAL_ARGS=-gpu lavapipe -no-audio
devices:
- /dev/kvm:/dev/kvm
ports:
- "6080:6080" # noVNC — open http://localhost:6080 to watch the emulator screen live
networks:
- splintercom
healthcheck:
test: ["CMD-SHELL", "test \"$(cat device_status)\" = READY"]
interval: 10s
timeout: 5s
retries: 40
start_period: 30s
# Builds the ClientAndroid APK, installs it into clientandroid-emulator, then pairs it headlessly
# — the Android equivalent of how `utility`'s register_device call pre-pairs clientpython with no
# manual steps. Pairing itself still goes through register_device (run by `utility`, writing to
# the client_tokens_android volume); this service's job is just to build+install the APK and
# deliver that already-issued token/settings pair into the running app via DevConfigReceiver (a
# debug-build-only broadcast receiver — see ClientAndroid/app/src/debug/), since there's no shared
# filesystem path into an Android app's own encrypted storage the way there is for clientpython's
# plain token file.
clientandroid:
build:
context: ./ClientAndroid
dockerfile: Dockerfile.dev
environment:
- HTTP_API_BASE_URL=http://backend:8000
- WEBSOCKET_API_BASE_URL=ws://backend:8000
- EMULATOR_HOST=clientandroid-emulator
depends_on:
clientandroid-emulator:
condition: service_healthy
utility:
condition: service_healthy
volumes:
- client_tokens_android:/tokens
networks:
- splintercom