124 lines
3.7 KiB
YAML
124 lines
3.7 KiB
YAML
services:
|
|
# ---------------------------------------------------------
|
|
# 1. Init-Container: erzeugt harbor.yml automatisch
|
|
# ---------------------------------------------------------
|
|
harbor-config:
|
|
image: alpine:${ALPINE_VERSION:-3.19}
|
|
container_name: ${HARBOR_CONFIG_CONTAINER:-harbor-config}
|
|
command: >
|
|
sh -c "
|
|
echo 'hostname: ${HARBOR_HOSTNAME}' > /config/harbor.yml &&
|
|
echo 'http:' >> /config/harbor.yml &&
|
|
echo ' port: ${HARBOR_HTTP_PORT}' >> /config/harbor.yml &&
|
|
echo 'https:' >> /config/harbor.yml &&
|
|
echo ' port: ${HARBOR_HTTPS_PORT}' >> /config/harbor.yml &&
|
|
echo ' certificate: /etc/harbor/tls/harbor.crt' >> /config/harbor.yml &&
|
|
echo ' private_key: /etc/harbor/tls/harbor.key' >> /config/harbor.yml &&
|
|
echo 'harbor_admin_password: ${HARBOR_ADMIN_PASSWORD}' >> /config/harbor.yml &&
|
|
echo 'data_volume: ${HARBOR_DATA_PATH}' >> /config/harbor.yml &&
|
|
echo 'log:' >> /config/harbor.yml &&
|
|
echo ' level: ${HARBOR_LOG_LEVEL}' >> /config/harbor.yml
|
|
"
|
|
volumes:
|
|
- harbor-config:/config
|
|
- ${HARBOR_DATA_PATH}/tls:/etc/harbor/tls:ro
|
|
restart: "no"
|
|
|
|
# ---------------------------------------------------------
|
|
# 2. Harbor Services (v2.11.x)
|
|
# ---------------------------------------------------------
|
|
log:
|
|
image: goharbor/harbor-log:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_LOG_CONTAINER:-harbor-log}
|
|
restart: always
|
|
volumes:
|
|
- ${HARBOR_DATA_PATH}/log:/var/log/docker
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- harbor-config
|
|
|
|
registry:
|
|
image: goharbor/registry-photon:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_REGISTRY_CONTAINER:-harbor-registry}
|
|
restart: always
|
|
volumes:
|
|
- ${HARBOR_DATA_PATH}/registry:/storage
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- harbor-config
|
|
|
|
core:
|
|
image: goharbor/harbor-core:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_CORE_CONTAINER:-harbor-core}
|
|
restart: always
|
|
environment:
|
|
- CORE_SECRET=${HARBOR_CORE_SECRET}
|
|
- JOBSERVICE_SECRET=${HARBOR_JOB_SECRET}
|
|
volumes:
|
|
- ${HARBOR_DATA_PATH}/core:/data
|
|
- harbor-config:/etc/harbor
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- registry
|
|
|
|
portal:
|
|
image: goharbor/harbor-portal:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_PORTAL_CONTAINER:-harbor-portal}
|
|
restart: always
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- core
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.harbor.entrypoints=websecure"
|
|
- "traefik.http.routers.harbor.rule=Host(`${HARBOR_HOSTNAME}`)"
|
|
- "traefik.http.routers.harbor.tls=true"
|
|
- "traefik.http.routers.harbor.tls.passthrough=true"
|
|
- "traefik.http.services.harbor.loadbalancer.server.port=${HARBOR_HTTPS_PORT}"
|
|
|
|
jobservice:
|
|
image: goharbor/harbor-jobservice:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_JOB_CONTAINER:-harbor-jobservice}
|
|
restart: always
|
|
volumes:
|
|
- ${HARBOR_DATA_PATH}/jobservice:/var/log/jobs
|
|
- harbor-config:/etc/harbor
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- core
|
|
|
|
database:
|
|
image: goharbor/harbor-db:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_DB_CONTAINER:-harbor-db}
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_PASSWORD=${HARBOR_DB_PASSWORD}
|
|
volumes:
|
|
- ${HARBOR_DATA_PATH}/database:/var/lib/postgresql/data
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- harbor-config
|
|
|
|
redis:
|
|
image: goharbor/redis-photon:${HARBOR_VERSION:-v2.11.0}
|
|
container_name: ${HARBOR_REDIS_CONTAINER:-harbor-redis}
|
|
restart: always
|
|
networks:
|
|
- harbor
|
|
depends_on:
|
|
- harbor-config
|
|
|
|
volumes:
|
|
harbor-config:
|
|
harbor-data:
|
|
|
|
networks:
|
|
harbor:
|
|
driver: bridge
|