-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (69 loc) · 2.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
70 lines (69 loc) · 2.62 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: "3.8"
services:
openproxy:
build: .
ports:
- "4623:4623"
volumes:
- ~/.config/openproxy:/root/.config/openproxy:ro
- ~/.local/share/openproxy:/root/.local/share/openproxy
environment:
- PORT=4623
- HOST=0.0.0.0
- JWT_SECRET=${JWT_SECRET:-}
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-}
# When deploying behind nginx/Caddy/Traefik, set TRUST_PROXY=true
# so the server reads X-Forwarded-For / X-Forwarded-Proto from the
# trusted proxy rather than stripping them.
- TRUST_PROXY=${TRUST_PROXY:-false}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4623/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
# ──────────────────────────────────────────────────────────────────────
# Reverse-proxy deployment notes
# ──────────────────────────────────────────────────────────────────────
#
# 1. Set TRUST_PROXY=true to preserve client IP from reverse-proxy
# forwarding headers (default false for security).
#
# 2. CORS: The embedded Axum server already sets:
# Access-Control-Allow-Origin: *
# Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
# Access-Control-Allow-Headers: Content-Type, Authorization, ...
# When the dashboard and API are served from the same origin via a
# reverse proxy, no additional CORS configuration is needed. For
# cross-origin setups, add CORS headers in the reverse proxy.
#
# Example docker-compose behind nginx:
#
# services:
# nginx:
# image: nginx:alpine
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
# depends_on:
# - openproxy
# openproxy:
# build: .
# environment:
# - TRUST_PROXY=true
# - JWT_SECRET=${JWT_SECRET:-}
# - ENCRYPTION_KEY=${ENCRYPTION_KEY:-}
# # No ports exposed — only nginx talks to openproxy internally
#
# For Traefik, label the openproxy service and omit the `ports` block:
#
# services:
# openproxy:
# ...
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.openproxy.rule=Host(`proxy.example.com`)"
# - "traefik.http.services.openproxy.loadbalancer.server.port=4623"
# # No ports; Traefik reaches the container via the internal docker network