harbor/docker-compose.yml

472 lines
10 KiB
YAML
Raw Normal View History

2023-12-12 20:13:25 +00:00
version: "3.0"
#
# updated: 2023-12-13
2023-12-12 20:13:25 +00:00
# stack: harbor
#
#
# Default login:
# admin / Harbor12345
#
# To do after git clone,
#
# Fix rights for config files:
# find conf/ -type f -exec chmod 0755 \{\} \;
#
# Setup permissions (with root):
# chown -R root:root .
# chown -R 10000:10000 datas/ca_download
# chown -R 10000:10000 datas/job_logs
# chown -R 10000:10000 datas/registry
# chown -R 999:999 datas/database
# chown -R 999:999 datas/redis
2023-12-12 20:13:25 +00:00
#
networks:
harbor:
name: harbor
driver: bridge
enable_ipv6: false
services:
harbor-log:
2023-12-12 20:13:25 +00:00
extends:
2023-12-12 20:20:05 +00:00
file: ./_vm/common.yml
2023-12-12 20:13:25 +00:00
service: x-common
user: 0:0
cap_add:
- CHOWN
2023-12-12 20:13:25 +00:00
- DAC_OVERRIDE
- SETGID
- SETUID
container_name: harbor-log
hostname: harbor-log
image: goharbor/harbor-log:v2.7.4
restart: "no"
ports:
- 0.0.0.0:1514:10514
networks:
- harbor
labels:
com.stack.name: "harbor"
com.stack.service.name: "log"
volumes:
- ./conf/log/logrotate.conf:/etc/logrotate.d/logrotate.conf:ro
- ./conf/log/rsyslog_docker.conf:/etc/rsyslog.d/rsyslog_docker.conf:ro
- ./datas/var/log/harbor/:/var/log/docker/:rw
deploy:
resources:
limits:
memory: 1G
pids: 8192
harbor-registry:
extends:
file: ./_vm/common.yml
service: x-common
user: 10000:10000
cap_add:
2023-12-12 20:13:25 +00:00
- CHOWN
- SETGID
- SETUID
2023-12-12 20:13:25 +00:00
container_name: harbor-registry
hostname: harbor-registry
image: goharbor/registry-photon:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
networks:
- harbor
labels:
com.stack.name: "harbor"
com.stack.service.name: "registry"
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./conf/registry/:/etc/registry/:z
- ./datas/secret/registry/root.crt:/etc/registry/root.crt:ro
2023-12-12 20:13:25 +00:00
- ./datas/registry:/storage:rw
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "registry"
2023-12-12 20:13:25 +00:00
harbor-registryctl:
extends:
file: ./_vm/host.yml
service: x-host
2023-12-12 20:13:25 +00:00
user: 0:0
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
2023-12-12 20:13:25 +00:00
- CHOWN
- SYS_ADMIN
- MKNOD
- DAC_READ_SEARCH
2023-12-12 20:13:25 +00:00
container_name: harbor-registryctl
hostname: harbor-registryctl
image: goharbor/harbor-registryctl:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
networks:
- harbor
env_file:
- ./conf/common/env
- ./conf/registryctl/env
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "registryctl"
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./conf/registry/:/etc/registry/:z
- ./conf/registryctl/config.yml:/etc/registryctl/config.yml:rw
2023-12-12 20:13:25 +00:00
- ./datas/registry:/storage:rw
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "registryctl"
2023-12-12 20:13:25 +00:00
harbor-postgresql:
extends:
file: ./_vm/common.yml
2023-12-12 20:13:25 +00:00
service: x-common
user: 999:999
privileged: true
2023-12-12 20:13:25 +00:00
cap_add:
- CHOWN
2023-12-12 20:13:25 +00:00
- DAC_OVERRIDE
- SETGID
- SETUID
2023-12-12 20:13:25 +00:00
container_name: harbor-postgresql
hostname: harbor-postgresql
image: goharbor/harbor-db:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
networks:
- harbor
env_file:
- ./conf/common/env
- ./conf/db/env
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "postgresql"
volumes:
- ./datas/database:/var/lib/postgresql/data:rw
tmpfs:
- /run/postgresql:rw,size=64M
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
shm_size: '1gb'
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "postgresql"
2023-12-12 20:13:25 +00:00
harbor-core:
extends:
file: ./_vm/host.yml
service: x-host
2023-12-12 20:13:25 +00:00
user: 0:0
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
2023-12-12 20:13:25 +00:00
- CHOWN
- SYS_ADMIN
- MKNOD
- DAC_READ_SEARCH
2023-12-12 20:13:25 +00:00
container_name: harbor-core
hostname: harbor-core
image: goharbor/harbor-core:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
networks:
- harbor
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
- harbor-registry
- harbor-redis
- harbor-postgresql
env_file:
- ./conf/common/env
- ./conf/core/env
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "core"
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./conf/core/certificates/:/etc/core/certificates/:z
2023-12-12 20:13:25 +00:00
- ./conf/core/app.conf:/etc/core/app.conf:ro
- ./datas/secret/core/private_key.pem:/etc/core/private_key.pem:ro
- ./datas/secret/keys/secretkey:/etc/core/key:ro
- ./datas/ca_download/:/etc/core/ca/:rw
- ./datas/:/data/:rw
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "core"
2023-12-12 20:13:25 +00:00
harbor-portal:
extends:
file: ./_vm/common.yml
2023-12-12 20:13:25 +00:00
service: x-common
user: 0:0
cap_add:
- CHOWN
- SETGID
- SETUID
- NET_BIND_SERVICE
2023-12-12 20:13:25 +00:00
container_name: harbor-portal
hostname: harbor-portal
image: goharbor/harbor-portal:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
networks:
- harbor
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "portal"
volumes:
- ./conf/portal/nginx.conf:/etc/nginx/nginx.conf:ro
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "portal"
2023-12-12 20:13:25 +00:00
harbor-jobservice:
extends:
file: ./_vm/host.yml
service: x-host
user: 10000:10000
2023-12-12 20:13:25 +00:00
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
2023-12-12 20:13:25 +00:00
- CHOWN
- SYS_ADMIN
- MKNOD
- DAC_READ_SEARCH
2023-12-12 20:13:25 +00:00
container_name: harbor-jobservice
hostname: harbor-jobservice
image: goharbor/harbor-jobservice:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
networks:
- harbor
depends_on:
- harbor-core
env_file:
- ./conf/common/env
- ./conf/jobservice/env
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "jobservice"
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./conf/jobservice/config.yml:/etc/jobservice/config.yml:rw
- ./datas/job_logs:/var/log/jobs:rw
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "jobservice"
2023-12-12 20:13:25 +00:00
harbor-redis:
extends:
file: ./_vm/common.yml
2023-12-12 20:13:25 +00:00
service: x-common
user: 999:999
2023-12-12 20:13:25 +00:00
cap_add:
- CHOWN
- SETGID
- SETUID
2023-12-12 20:13:25 +00:00
container_name: harbor-redis
hostname: harbor-redis
image: goharbor/redis-photon:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
networks:
- harbor
labels:
com.stack.name: "harbor"
com.stack.service.name: "redis"
volumes:
- /data/redis:/var/lib/redis:rw
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "redis"
2023-12-12 20:13:25 +00:00
harbor-proxy:
2023-12-12 20:13:25 +00:00
extends:
file: ./_vm/common.yml
2023-12-12 20:13:25 +00:00
service: x-common
user: 0:0
cap_add:
- CHOWN
- SETGID
- SETUID
- NET_BIND_SERVICE
container_name: harbor-proxy
hostname: harbor-proxy
image: goharbor/nginx-photon:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
ports:
- 80:8080
- 443:8443
- 9090:9090
2023-12-12 20:13:25 +00:00
networks:
- harbor
depends_on:
- harbor-registry
- harbor-core
- harbor-portal
- harbor-log
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "proxy"
2023-12-12 20:13:25 +00:00
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./datas/secret/cert:/etc/cert:ro
- ./conf/nginx:/etc/nginx:rw
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "proxy"
2023-12-12 20:13:25 +00:00
harbor-trivy-adapter:
2023-12-12 20:13:25 +00:00
extends:
file: ./_vm/host.yml
service: x-host
2023-12-12 20:13:25 +00:00
user: 0:0
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
2023-12-12 20:13:25 +00:00
- CHOWN
- SYS_ADMIN
- MKNOD
- DAC_READ_SEARCH
container_name: harbor-trivy-adapter
hostname: harbor-trivy-adapter
image: goharbor/trivy-adapter-photon:v2.7.4
2023-12-12 20:13:25 +00:00
restart: "no"
ports:
- 8888:8080
networks:
- harbor
depends_on:
- harbor-log
2023-12-12 20:13:25 +00:00
- harbor-redis
env_file:
./conf/trivy-adapter/env
2023-12-12 20:13:25 +00:00
labels:
com.stack.name: "harbor"
com.stack.service.name: "trivy-adapter"
2023-12-12 20:13:25 +00:00
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
- ./datas/trivy-adapter/trivy:/home/scanner/.cache/trivy:rw
- ./datas/trivy-adapter/reports:/home/scanner/.cache/reports:rw
tmpfs:
- /tmp:rw,size=1G
2023-12-12 20:13:25 +00:00
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "trivy-adapter"
2023-12-12 20:13:25 +00:00
harbor-exporter:
extends:
file: ./_vm/host.yml
service: x-host
user: 0:0
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
- CHOWN
- SYS_ADMIN
- MKNOD
- DAC_READ_SEARCH
container_name: harbor-exporter
hostname: harbor-exporter
image: goharbor/harbor-exporter:v2.7.4
restart: "no"
networks:
- harbor
depends_on:
- harbor-core
- harbor-postgresql
env_file:
- ./conf/common/env
- ./conf/exporter/env
labels:
com.stack.name: "harbor"
com.stack.service.name: "exporter"
volumes:
- ./conf/shared/trust-certificates:/harbor_cust_cert:ro
deploy:
resources:
limits:
memory: 1G
pids: 8192
logging:
driver: "syslog"
options:
syslog-address: "tcp://0.0.0.0:1514"
tag: "exporter"