Commit 8269de6
authored
fix(deploy): split host-specific config, sync templates from CI (#33)
* fix(deploy): sync compose.prod.yml to server before restart
Server had stale compose.prod.yml with STATIC_DIR=/app/frontend/dist,
but the current image serves static assets from /app/web/dist
(renamed in #30). Prod served 404 on /.
Deploy now checks out the repo and scps compose.prod.yml to the
server so env config stays in lockstep with the image.
* docs(deploy): sync graphhopper config too, document minimal server layout
Extend the scp step to ship backend/graphhopper_config.yml alongside
compose.prod.yml so every file compose.prod.yml references comes from
CI. Add DEPLOY.md describing the authoritative server layout and the
rule that anything not referenced by compose.prod.yml should be
deleted from the server.
* refactor(deploy): split host-specific config into server-side .env
Previously compose.prod.yml entangled app config (STATIC_DIR, LISTEN_ADDR,
PHOTON_URL — all image-bakable), orchestration (service wiring) and host
identity (DB password, memory limits, host ports) in one file that CI
overwrote on every deploy. This let image/compose drift break prod (the
STATIC_DIR /app/frontend/dist vs /app/web/dist mismatch that served 404
on /) and kept secrets in git.
New split:
- Image defaults own app config (already the case in backend/src/config.rs
and backend/Dockerfile; compose just stops overriding them).
- compose.prod.yml is a pure orchestration template with ${VAR} refs,
synced by CI.
- Host-specific values live in ~/beebeebike/.env on the prod host:
POSTGRES_PASSWORD, memory limits (DB_MEM_LIMIT, GRAPHHOPPER_MEM_LIMIT,
TILES_MEM_LIMIT, BACKEND_MEM_LIMIT), Postgres tuning, GRAPHHOPPER_JAVA_OPTS,
reverse-proxy-facing host ports. Never committed, never touched by CI.
.env.example documents the schema.
Deploy now pulls all images and recreates the whole stack (needed once
because graphhopper's config mount moved to backend/graphhopper_config.yml
and the tiles/db services pick up their memory limits from .env).1 parent 7986e7b commit 8269de6
3 files changed
Lines changed: 64 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | | - | |
131 | | - | |
| 143 | + | |
| 144 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | | - | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
29 | | - | |
30 | | - | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
37 | | - | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
41 | | - | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | | - | |
| 59 | + | |
49 | 60 | | |
50 | | - | |
| 61 | + | |
51 | 62 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
58 | | - | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
0 commit comments