Skip to content

Commit f4e8359

Browse files
docker-compose docs
1 parent 9056114 commit f4e8359

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ cp .env.example .env
3636
docker compose -f docker-compose.prod.yml --env-file .env up -d --build
3737
```
3838

39+
If Compose fails because port 80 (or 443) is already in use, see **Production** / troubleshooting in [`docs-site/README.md`](docs-site/README.md).
40+
3941
## Installation
4042

4143
```bash

docs-site/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
OXYJWT_DOCS_DOMAIN=oxyjwt.queryahub.com
22
ACME_EMAIL=admin@queryahub.com
3+
4+
# Only used by docker-compose.prod.yml for Caddy’s published ports on the host.
5+
# Defaults 80/443. Change if those ports are already in use (see docs-site/README.md).
6+
# CADDY_HTTP_PORT=80
7+
# CADDY_HTTPS_PORT=443

docs-site/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,20 @@ The site will be available at `https://oxyjwt.queryahub.com`.
5555
Server requirements:
5656

5757
- DNS for `oxyjwt.queryahub.com` points to this server.
58-
- Ports `80` and `443` are open.
59-
- No other service is already using ports `80` or `443`.
58+
- Ports `80` and `443` are open to the public internet (or HTTP-01 certificate issuance can fail).
59+
- **Nothing else** should bind the **same** host ports that Caddy uses for this stack.
60+
61+
### “Bind for 0.0.0.0:80 failed: port is already allocated”
62+
63+
Port `80` (or `443`) on the machine is already used — often by another reverse proxy, OpenLiteSpeed, or a second Docker Compose project.
64+
65+
1. **Preferred if you already have a reverse proxy on 80/443**
66+
Do not publish Caddy on the host. Run only the static site, or add an upstream in your **existing** proxy for `Host: oxyjwt.queryahub.com` to the Nginx in the `docs` service. Example: expose the docs container on `127.0.0.1:9080` and configure your main proxy to `proxy_pass` there with TLS. This stack is then a single `docs` service without the bundled `caddy` service, or Caddy is internal-only (no `ports:` on `caddy`).
67+
68+
2. **If this server should be the only listener on 80/443**
69+
Stop or rebind the other service (for example, move it behind the same Caddy) so **this** Caddy can bind `80:80` and `443:443`.
70+
71+
3. **Temporary / non-standard host ports (not for public HTTPS on default ports)**
72+
In `.env` you can set host ports, for example:
73+
`CADDY_HTTP_PORT=18080` and `CADDY_HTTPS_PORT=18443`.
74+
Let’s Encrypt **HTTP-01** validation still expects port **80** on your **public** IP. If the world still hits another process on 80, certificates will not issue correctly unless you use a DNS challenge (not configured in the bundled `Caddyfile`) or terminate TLS in front of this Caddy.

docs-site/docker-compose.prod.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ services:
1515
environment:
1616
ACME_EMAIL: "${ACME_EMAIL:-admin@queryahub.com}"
1717
OXYJWT_DOCS_DOMAIN: "${OXYJWT_DOCS_DOMAIN:-oxyjwt.queryahub.com}"
18+
# Host ports must be free. If 80/443 are taken by another reverse proxy, do not
19+
# publish Caddy on the host: put `oxyjwt.queryahub.com` in that proxy and only
20+
# expose the `docs` service (or run Caddy on other host ports and read README).
1821
ports:
19-
- "80:80"
20-
- "443:443"
22+
- "${CADDY_HTTP_PORT:-80}:80"
23+
- "${CADDY_HTTPS_PORT:-443}:443"
2124
restart: unless-stopped
2225
volumes:
2326
- ./Caddyfile:/etc/caddy/Caddyfile:ro

0 commit comments

Comments
 (0)