Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (56 loc) · 1.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
58 lines (56 loc) · 1.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
services:
proxy:
build: .
image: oaiproxy:latest
restart: unless-stopped
# Only the proxy receives the upstream key; Caddy never sees it.
env_file: .env
environment:
TOKENS_FILE: /config/tokens.json
LISTEN_ADDR: ":8080"
# Private container listener; admin override publishes host-loopback only.
ADMIN_LISTEN_ADDR: ":8081"
# Prometheus metrics (client ids + usage) are off by default. If enabled,
# they are unauthenticated and reachable from any container on this
# network, so only enable where that network is trusted.
# METRICS_ADDR: ":9090"
volumes:
- proxy_config:/config
# The upstream key file is mounted by deploy/docker-compose.keyfile.yml
# (enabled via COMPOSE_FILE in .env; scripts/setup.sh does all of this).
expose:
- "8080"
read_only: true
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
healthcheck:
test: ["CMD", "/oaiproxy", "healthcheck"]
interval: 15s
timeout: 5s
retries: 3
logging:
driver: json-file
options: { max-size: "50m", max-file: "5" }
caddy:
build:
context: .
dockerfile: deploy/caddy/Dockerfile
image: oaiproxy-caddy:latest
restart: unless-stopped
depends_on:
proxy:
condition: service_healthy
ports:
- "80:80"
- "443:443"
- "443:443/udp"
environment:
PROXY_DOMAIN: ${PROXY_DOMAIN:?set PROXY_DOMAIN in .env}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
volumes:
proxy_config:
caddy_data:
caddy_config: