Files
deploy.stack/harbor/compose.yaml
T
cnphpbb 9becdc5e21 chore(harbor): 更新 2.15.4 部署配置
移除 harbor-log 服务并改用 json-file 日志轮转

将 Redis 组件替换为 Valkey,并同步部署文档
2026-11-04 12:02:57 +08:00

197 lines
4.6 KiB
YAML

services:
registry:
image: goharbor/registry-photon:v2.15.4
container_name: registry
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
volumes:
- /data/harbor/registry:/storage:z
- /data/harbor/common/config/registry/:/etc/registry/:z
- /data/harbor/secret/registry/root.crt:/etc/registry/root.crt
- /data/harbor/common/config/shared/trust-certificates:/harbor_cust_cert
networks:
- harbor
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
registryctl:
image: goharbor/harbor-registryctl:v2.15.4
container_name: registryctl
env_file:
- /data/harbor/common/config/registryctl/env
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
volumes:
- /data/harbor/registry:/storage:z
- /data/harbor/common/config/registry/:/etc/registry/:z
- /data/harbor/common/config/registryctl/config.yml:/etc/registryctl/config.yml
- /data/harbor/common/config/shared/trust-certificates:/harbor_cust_cert
networks:
- harbor
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
postgresql:
image: goharbor/harbor-db:v2.15.4
container_name: harbor-db
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETGID
- SETUID
volumes:
- /data/harbor/database:/var/lib/postgresql/data:z
networks:
harbor:
env_file:
- /data/harbor/common/config/db/env
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
shm_size: '1gb'
core:
image: goharbor/harbor-core:v2.15.4
container_name: harbor-core
env_file:
- /data/harbor/common/config/core/env
restart: always
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
volumes:
- /data/harbor/ca_download/:/etc/core/ca/:z
- /data/harbor/:/data/:z
- /data/harbor/common/config/core/certificates/:/etc/core/certificates/:z
- /data/harbor/common/config/core/app.conf:/etc/core/app.conf
- /data/harbor/secret/core/private_key.pem:/etc/core/private_key.pem
- /data/harbor/data/harbor/secret/keys/secretkey:/etc/core/key
- /data/harbor/common/config/shared/trust-certificates:/harbor_cust_cert
networks:
harbor:
depends_on:
- registry
- redis
- postgresql
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
portal:
image: goharbor/harbor-portal:v2.15.4
container_name: harbor-portal
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- NET_BIND_SERVICE
volumes:
- /data/harbor/common/config/portal/nginx.conf:/etc/nginx/nginx.conf
networks:
- harbor
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
jobservice:
image: goharbor/harbor-jobservice:v2.15.4
container_name: harbor-jobservice
env_file:
- /data/harbor/common/config/jobservice/env
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
volumes:
- /data/harbor/job_logs:/var/log/jobs:z
- /data/harbor/common/config/jobservice/config.yml:/etc/jobservice/config.yml
- /data/harbor/common/config/shared/trust-certificates:/harbor_cust_cert
networks:
- harbor
depends_on:
- core
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
redis:
image: goharbor/valkey-photon:v2.15.4
container_name: redis
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
volumes:
- /data/harbor/redis:/var/lib/redis
networks:
harbor:
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
proxy:
image: goharbor/nginx-photon:v2.15.4
container_name: nginx
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- NET_BIND_SERVICE
volumes:
- /data/harbor/common/config/nginx:/etc/nginx:z
- /data/harbor/common/config/shared/trust-certificates:/harbor_cust_cert
networks:
- harbor
ports:
- 8080:8080
- 8443:8443
depends_on:
- registry
- core
- portal
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
harbor:
external: false