|
1 | | -# Example: add OpenConcho's web UI to a self-hosted Honcho Docker Compose stack. |
| 1 | +# Run OpenConcho's web UI with `docker compose up`. |
2 | 2 | # |
3 | | -# Drop this `openconcho` service into the Compose project that already runs your |
4 | | -# Honcho `api` service. nginx proxies /v3 and /health to the API, so the browser |
5 | | -# makes same-origin requests and never hits CORS. |
| 3 | +# Standalone: serves the SPA on http://localhost:8080 and reverse-proxies the |
| 4 | +# Honcho API under the same origin (no browser CORS). By default it points at a |
| 5 | +# Honcho running on the host at :8000 — override HONCHO_UPSTREAM for anything else: |
| 6 | +# |
| 7 | +# HONCHO_UPSTREAM=https://honcho.example.net docker compose up |
| 8 | +# |
| 9 | +# To fold this into an existing Honcho Compose stack, drop the `openconcho` |
| 10 | +# service into that project, set HONCHO_UPSTREAM to the api service |
| 11 | +# (e.g. http://api:8000), and add `depends_on: { api: { condition: service_healthy } }`. |
6 | 12 | services: |
7 | 13 | openconcho: |
8 | 14 | image: ghcr.io/offendingcommit/openconcho-web:latest |
9 | 15 | # Or build from this repo instead of pulling the published image: |
10 | 16 | # build: . |
11 | 17 | environment: |
12 | 18 | # nginx reverse-proxies /v3 and /health to this upstream (the Honcho API). |
13 | | - HONCHO_UPSTREAM: http://api:8000 |
| 19 | + HONCHO_UPSTREAM: ${HONCHO_UPSTREAM:-http://host.docker.internal:8000} |
14 | 20 | # The SPA defaults its Honcho base URL to its own origin, so requests flow |
15 | 21 | # through the proxy above — no browser CORS, token never leaves the origin. |
16 | | - # Set to an absolute URL instead to point the UI at a different backend. |
17 | 22 | OPENCONCHO_DEFAULT_HONCHO_URL: same-origin |
18 | 23 | ports: |
19 | 24 | - "127.0.0.1:8080:8080" |
20 | | - depends_on: |
21 | | - api: |
22 | | - condition: service_healthy |
| 25 | + # Lets the default host.docker.internal upstream resolve on Linux too |
| 26 | + # (Docker Desktop / Colima provide it automatically). |
| 27 | + extra_hosts: |
| 28 | + - "host.docker.internal:host-gateway" |
23 | 29 | restart: unless-stopped |
0 commit comments