-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (41 loc) · 1.35 KB
/
docker-compose.yml
File metadata and controls
46 lines (41 loc) · 1.35 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
services:
go-docker-proxy:
build: .
ports:
- "8080:8080"
environment:
# 基础配置
- PORT=8080
- CUSTOM_DOMAIN=example.com
# 缓存配置
- CACHE_DIR=/cache
- CACHE_ENABLED=true # true=启用缓存, false=禁用缓存
- CACHE_MANIFEST_TTL=1d # manifest by tag 缓存时间 (支持: 1h, 1d, 1w, 1M, 1y)
- CACHE_BLOB_TTL=1y # blob 缓存时间 (SHA256 内容不可变)
- FOLLOW_ALL_REDIRECTS=true # true=跟随所有重定向并缓存, false=外部存储返回302给客户端
# 黑名单配置 (访问受限的域名,逗号分隔)
# 示例: BLOCKED_HOSTS=example.com,another.com
- BLOCKED_HOSTS=
# 自定义DNS配置
- DNS_ENABLED=false # true=启用自定义DNS, false=使用系统DNS
- DNS_SERVERS=8.8.8.8:53,8.8.4.4:53 # DNS服务器列表,逗号分隔
- DNS_TIMEOUT=5s # DNS查询超时时间
# 调试和开发
- DEBUG=true
- TARGET_UPSTREAM=https://registry-1.docker.io
volumes:
- cache_data:/cache
restart: unless-stopped
healthcheck:
test: ["CMD", "/go-docker-proxy", "-health-check"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
volumes:
cache_data:
driver: local
driver_opts:
type: none
o: bind
device: "./cache"