Files
container/harbor/docker-compose.yml

141 lines
4.1 KiB
YAML
Raw Normal View History

2026-01-02 21:02:45 +00:00
version: "3.9"
2026-01-02 20:19:23 +00:00
services:
# ---------------------------------------------------------
2026-01-02 20:57:27 +00:00
# 1. Init-Container: erzeugt harbor.yml (OHNE HTTPS!)
2026-01-02 20:19:23 +00:00
# ---------------------------------------------------------
harbor-config:
image: alpine:${ALPINE_VERSION:-3.19}
container_name: ${HARBOR_CONFIG_CONTAINER:-harbor-config}
2026-01-02 20:43:07 +00:00
entrypoint: ["/bin/sh", "-c"]
command: |
set -e
2026-01-02 22:28:21 +00:00
mkdir -p /etc/harbor
cat <<EOF > /etc/harbor/harbor.yml
2026-01-02 20:43:07 +00:00
hostname: ${HARBOR_HOSTNAME:-harbor.local}
http:
2026-01-02 22:41:10 +00:00
port: ${HARBOR_HTTP_PORT:-8080}
2026-01-02 20:43:07 +00:00
harbor_admin_password: ${HARBOR_ADMIN_PASSWORD:-Harbor12345}
2026-01-02 22:41:10 +00:00
data_volume: ${HARBOR_DATA_PATH:-/opt/docker/harbor/data}
2026-01-02 20:43:07 +00:00
log:
level: ${HARBOR_LOG_LEVEL:-info}
EOF
2026-01-02 20:19:23 +00:00
volumes:
2026-01-02 22:28:21 +00:00
- "${HARBOR_DATA_PATH:-/data/harbor}/config:/etc/harbor"
2026-01-02 20:19:23 +00:00
restart: "no"
2026-01-02 20:43:07 +00:00
networks:
- harbor
2026-01-02 20:19:23 +00:00
2026-01-02 22:28:21 +00:00
2026-01-02 20:19:23 +00:00
# ---------------------------------------------------------
2026-01-02 21:39:10 +00:00
# 2. Harbor Services
2026-01-02 20:19:23 +00:00
# ---------------------------------------------------------
log:
image: goharbor/harbor-log:${HARBOR_VERSION:-v2.11.0}
container_name: ${HARBOR_LOG_CONTAINER:-harbor-log}
restart: always
volumes:
2026-01-02 20:43:07 +00:00
- "${HARBOR_DATA_PATH:-/data/harbor}/log:/var/log/docker"
2026-01-02 20:19:23 +00:00
networks:
- harbor
depends_on:
- harbor-config
2026-01-02 21:39:10 +00:00
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:-root123}
volumes:
- "${HARBOR_DATA_PATH:-/data/harbor}/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
2026-01-02 20:19:23 +00:00
registry:
image: goharbor/registry-photon:${HARBOR_VERSION:-v2.11.0}
container_name: ${HARBOR_REGISTRY_CONTAINER:-harbor-registry}
restart: always
volumes:
2026-01-02 20:43:07 +00:00
- "${HARBOR_DATA_PATH:-/data/harbor}/registry:/storage"
2026-01-02 20:19:23 +00:00
networks:
- harbor
2026-01-02 21:39:10 +00:00
- proxy
2026-01-02 20:19:23 +00:00
depends_on:
- harbor-config
2026-01-02 21:39:10 +00:00
labels:
- "traefik.enable=true"
2026-01-02 22:16:33 +00:00
- "traefik.http.routers.harbor-registry.rule=Host(`${HARBOR_HOSTNAME}`) && PathPrefix(`/v2/`)"
2026-01-02 21:39:10 +00:00
- "traefik.http.routers.harbor-registry.entrypoints=websecure"
- "traefik.http.routers.harbor-registry.tls=true"
2026-01-02 22:23:37 +00:00
- "traefik.http.routers.harbor-registry.tls.certresolver=le"
2026-01-02 21:58:54 +00:00
- "traefik.docker.network=proxy"
2026-01-02 20:19:23 +00:00
core:
image: goharbor/harbor-core:${HARBOR_VERSION:-v2.11.0}
container_name: ${HARBOR_CORE_CONTAINER:-harbor-core}
restart: always
environment:
2026-01-02 20:43:07 +00:00
- CORE_SECRET=${HARBOR_CORE_SECRET:-coresecret}
- JOBSERVICE_SECRET=${HARBOR_JOB_SECRET:-jobsecret}
2026-01-02 20:19:23 +00:00
volumes:
2026-01-02 20:43:07 +00:00
- "${HARBOR_DATA_PATH:-/data/harbor}/core:/data"
- "${HARBOR_DATA_PATH:-/data/harbor}/config:/etc/harbor"
2026-01-02 20:19:23 +00:00
networks:
- harbor
depends_on:
- registry
2026-01-02 20:43:07 +00:00
- database
- redis
2026-01-02 20:19:23 +00:00
portal:
image: goharbor/harbor-portal:${HARBOR_VERSION:-v2.11.0}
2026-01-02 20:46:16 +00:00
container_name: ${HARBOR_PORTAL_CONTAINER:-harbor-portal}
restart: always
networks:
- harbor
- proxy
depends_on:
2026-01-02 22:26:08 +00:00
- core
2026-01-02 20:46:16 +00:00
labels:
- "traefik.enable=true"
2026-01-02 22:16:33 +00:00
- "traefik.http.routers.harbor-ui.rule=Host(`${HARBOR_HOSTNAME}`)"
2026-01-02 21:33:07 +00:00
- "traefik.http.routers.harbor-ui.entrypoints=websecure"
- "traefik.http.routers.harbor-ui.tls=true"
2026-01-02 22:23:37 +00:00
- "traefik.http.routers.harbor-ui.tls.certresolver=le"
2026-01-02 21:58:54 +00:00
- "traefik.docker.network=proxy"
2026-01-02 20:46:16 +00:00
jobservice:
image: goharbor/harbor-jobservice:${HARBOR_VERSION:-v2.11.0}
container_name: ${HARBOR_JOB_CONTAINER:-harbor-jobservice}
restart: always
volumes:
- "${HARBOR_DATA_PATH:-/data/harbor}/jobservice:/var/log/jobs"
- "${HARBOR_DATA_PATH:-/data/harbor}/config:/etc/harbor"
networks:
- harbor
depends_on:
- core
# ---------------------------------------------------------
# Netzwerke
# ---------------------------------------------------------
networks:
harbor:
driver: bridge
proxy:
external: true