feat(nginx): bake default white-label routing config, closes #1 #2

Merged
libretech merged 1 commits from feat/default-nginx-config into main 2026-04-29 19:38:53 +02:00
Owner

Summary

  • Add nginx.conf.template with full routing: admin/CMS surfaces → cms:5555, uploads → cms:5555 (cached), /apishop:9999 (no cache), /shop:9999 (cached)
  • Update docker-entrypoint.sh to render template via envsubst at startup; skip if adapter has already mounted its own config
  • Update Dockerfile to COPY nginx.conf.template into image
  • Bump CHANGELOG to v0.1.1

Test plan

  • Build image locally: docker build -t libreshop/nginx:test libreshop/nginx/
  • Smoke test white-label default: no env overrides → confirm rendered /etc/nginx/nginx.conf contains cms:5555 and shop:9999
  • Smoke test env override: NGINX_UPSTREAM_SHOP=shop:8080 → confirm substitution
  • Smoke test adapter override: mount custom nginx.conf via compose configs: → confirm "adapter-provided nginx.conf detected" log line
  • Deploy libreshop/demo with nginx:v0.1.1 → confirm /admin returns 200

Closes #1

## Summary - Add `nginx.conf.template` with full routing: admin/CMS surfaces → `cms:5555`, uploads → `cms:5555` (cached), `/api` → `shop:9999` (no cache), `/` → `shop:9999` (cached) - Update `docker-entrypoint.sh` to render template via `envsubst` at startup; skip if adapter has already mounted its own config - Update `Dockerfile` to `COPY nginx.conf.template` into image - Bump CHANGELOG to v0.1.1 ## Test plan - [ ] Build image locally: `docker build -t libreshop/nginx:test libreshop/nginx/` - [ ] Smoke test white-label default: no env overrides → confirm rendered `/etc/nginx/nginx.conf` contains `cms:5555` and `shop:9999` - [ ] Smoke test env override: `NGINX_UPSTREAM_SHOP=shop:8080` → confirm substitution - [ ] Smoke test adapter override: mount custom `nginx.conf` via compose `configs:` → confirm "adapter-provided nginx.conf detected" log line - [ ] Deploy libreshop/demo with `nginx:v0.1.1` → confirm `/admin` returns 200 Closes #1
libretech added 1 commit 2026-04-29 19:29:18 +02:00
feat: bake default white-label nginx.conf into the image
All checks were successful
Build and publish / build (pull_request) Successful in 19s
edd3dee3d9
The image used to ship just nginx + an entrypoint, with no routing
config — adapters had to mount their own nginx.conf via compose
`configs:` for anything to work. This broke the standalone
libreshop/demo preview (`curl /admin` returned 404).

Add a default nginx.conf.template that routes the standard libreshop
surface (`/admin`, `/uploads`, `/api`, `/`, ...) to
`${NGINX_UPSTREAM_CMS:-cms:5555}` / `${NGINX_UPSTREAM_SHOP:-shop:9999}`,
plus health and forwarded-headers handling. The entrypoint runs
envsubst at startup, then nginx.

Adapter override path is preserved: if compose `configs:` already
replaced /etc/nginx/nginx.conf with a non-stock file (detected via
the absence of the upstream nginx `worker_processes  auto;` line),
the entrypoint leaves it untouched.

Closes #1.
libretech merged commit 9cfd4163f6 into main 2026-04-29 19:38:53 +02:00
libretech deleted branch feat/default-nginx-config 2026-04-29 19:38:57 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: libreshop/nginx#2
No description provided.