-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose-dev.yaml
More file actions
83 lines (80 loc) · 2.66 KB
/
Copy pathcompose-dev.yaml
File metadata and controls
83 lines (80 loc) · 2.66 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
# PlugTrack v2 — source-build compose file.
#
# Builds both images from the local source tree. Use this when
# developing or self-deploying from the repo (the scripts under
# `scripts/` invoke this file for you). Downstream consumers who just
# want to run the app should use `compose.yaml`, which pulls pre-built
# images from GHCR.
#
# docker compose -f compose-dev.yaml build
# docker compose -f compose-dev.yaml up -d
#
# Two services on a shared bridge network:
# plugtrack-api — FastAPI on :9278
# plugtrack-ui — nginx serving the React SPA on :80, exposed as :9279,
# reverse-proxying /api/* to plugtrack-api:9278.
#
# Persistent state lives under /dockerdata/plugtrack on the host so
# upgrades just rebuild containers.
services:
plugtrack-api:
build:
context: ./backend
container_name: plugtrack-api
env_file:
- .env
environment:
DATA_DIR: /app/data
# Optional: MCP_ALLOWED_HOSTS (set it in .env) opts the /mcp endpoint
# INTO strict Host-header validation (HTTP 421 for anything else).
# Leave it unset for the LAN default: validation disabled, so access
# via a reverse-proxied internal FQDN keeps working. See .env.example.
ports:
# Bind the API to loopback only. The UI container reaches it over the
# docker bridge as `plugtrack-api:9278` (see frontend/nginx.conf), so the
# published port is purely for local debugging — exposing it on all
# interfaces would bypass nginx's CSP/security headers. Publish only the
# UI's 9279 (or a reverse proxy) for remote access.
- "127.0.0.1:9278:9278"
volumes:
- /dockerdata/plugtrack/data:/app/data
- /dockerdata/plugtrack/logs:/app/logs
restart: unless-stopped
healthcheck:
# Inherit the HEALTHCHECK baked into the image. Re-declared here
# so `docker compose ps` shows it explicitly and depends_on can
# gate on service_healthy.
test:
- CMD
- python
- -c
- "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:9278/api/health', timeout=3).status == 200 else 1)"
interval: 30s
timeout: 5s
start_period: 20s
retries: 3
plugtrack-ui:
build:
context: ./frontend
container_name: plugtrack-ui
ports:
- "9279:80"
depends_on:
plugtrack-api:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
- CMD
- wget
- --quiet
- --tries=1
- --spider
- http://localhost/
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
networks:
default:
driver: bridge