File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ The Markdown body is rendered on episode detail pages.
7979- Keep admin APIs under ` /api/admin/* ` protected by ` getAdminFromContext ` .
8080- Keep Redis as a defensive/cache layer only. Markdown files remain the content
8181 source of truth.
82+ - Keep production Redis external. Local Compose may start Redis for development,
83+ but production Compose must consume ` REDIS_URL ` from the private server
84+ environment instead of creating a Redis service.
8285- Public GET/HEAD pages should keep short cache headers and query stripping so
8386 random query parameters do not bypass caches.
8487- Keep staging safe for search engines: ` PUBLIC_ALLOW_INDEXING=false ` until the
Original file line number Diff line number Diff line change @@ -104,13 +104,16 @@ Check the production-style Compose config with explicit placeholder values:
104104``` bash
105105JWT_SECRET=dev-secret \
106106ADMIN_PASSWORD=dev-password \
107- REDIS_PASSWORD=dev-redis-password \
108- REDIS_URL=redis://:dev-redis-password@redis:6379 \
107+ REDIS_URL=redis://:dev-redis-password@redis.example.internal:6379 \
109108docker compose -f docker-compose.prod.yml config
110109```
111110
112111In Docker, mount the episode directory to ` /app/content/episodes ` .
113112
113+ Local Compose starts a Redis container for development. Production Compose does
114+ not create Redis; set ` REDIS_URL ` to an existing private Redis service in the
115+ server environment.
116+
114117## Deployment
115118
116119The deployment helper is intentionally parameterized. Pass your own SSH host,
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ pnpm audit --audit-level moderate
3939docker compose config
4040JWT_SECRET=dev-secret \
4141ADMIN_PASSWORD=dev-password \
42- REDIS_PASSWORD=dev-redis-password \
43- REDIS_URL=redis://:dev-redis-password@redis:6379 \
42+ REDIS_URL=redis://:dev-redis-password@redis.example.internal:6379 \
4443docker compose -f docker-compose.prod.yml config
4544```
Original file line number Diff line number Diff line change 11name : webworker-tech-new
22
33services :
4- redis :
5- image : ${REDIS_IMAGE:-redis:7.0.15}
6- restart : unless-stopped
7- command : ["sh", "-c", "redis-server --requirepass \"$$REDIS_PASSWORD\""]
8- environment :
9- REDIS_PASSWORD : ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
10- volumes :
11- - redis_data:/data
12- healthcheck :
13- test : ["CMD-SHELL", "REDISCLI_AUTH=\"$$REDIS_PASSWORD\" redis-cli ping"]
14- interval : 10s
15- timeout : 5s
16- retries : 12
17-
184 app :
195 image : ${IMAGE_NAME:-webworker-tech:ssr-amd64}
206 restart : unless-stopped
@@ -41,9 +27,3 @@ services:
4127 interval : 30s
4228 timeout : 5s
4329 retries : 5
44- depends_on :
45- redis :
46- condition : service_healthy
47-
48- volumes :
49- redis_data :
Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ PUBLIC_ALLOW_INDEXING=false
4141JWT_SECRET=< long-random-secret>
4242ADMIN_USERNAME=admin
4343ADMIN_PASSWORD=< strong-password>
44- REDIS_PASSWORD=< strong-redis-password>
45- REDIS_URL=redis://:< strong-redis-password> @redis:6379
44+ REDIS_URL=redis://:< strong-redis-password> @redis.example.internal:6379
4645RSS_AUTO_SYNC=true
4746RSS_AUTO_SYNC_INTERVAL_HOURS=24
4847HOST_PORT=4322
@@ -53,6 +52,9 @@ IMAGE_NAME=webworker-tech:ssr-amd64
5352Prefer ` ADMIN_PASSWORD_SHA256 ` over ` ADMIN_PASSWORD ` when the runtime makes
5453secret rotation manageable.
5554
55+ Production Compose expects Redis to be an existing private service. It does not
56+ start its own Redis container.
57+
5658## Deploy
5759
5860Pass private deployment details through environment variables:
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ ssh "$REMOTE_HOST" "
5353set -eu
5454cd '$REMOTE_APP_DIR '
5555docker load -i '$REMOTE_ROOT /$( basename " $TAR_PATH " ) '
56- EPISODES_HOST_DIR='$REMOTE_CONTENT_DIR ' IMAGE_NAME='$IMAGE_NAME ' docker compose --env-file '$ENV_FILE ' -f docker-compose.prod.yml up -d
56+ EPISODES_HOST_DIR='$REMOTE_CONTENT_DIR ' IMAGE_NAME='$IMAGE_NAME ' docker compose --env-file '$ENV_FILE ' -f docker-compose.prod.yml up -d --remove-orphans
5757for i in \$ (seq 1 20); do
5858 if curl -fsS http://127.0.0.1:$REMOTE_HOST_PORT /api/health >/dev/null 2>&1; then
5959 exit 0
You can’t perform that action at this time.
0 commit comments