mirror of
https://github.com/KohakuBlueleaf/KohakuHub.git
synced 2026-03-11 17:34:08 -05:00
132 lines
5.3 KiB
YAML
132 lines
5.3 KiB
YAML
# docker-compose.yml
|
|
|
|
services:
|
|
hub-ui:
|
|
image: nginx:alpine
|
|
container_name: hub-ui
|
|
restart: always
|
|
ports:
|
|
- "28080:80" # Expose Web UI on host port 28080
|
|
volumes:
|
|
- ./src/kohaku-hub-ui/dist:/usr/share/nginx/html # Mount the built main frontend assets
|
|
- ./src/kohaku-hub-admin/dist:/usr/share/nginx/html-admin # Mount the built admin frontend assets
|
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf # Mount the Nginx configuration
|
|
depends_on:
|
|
- hub-api
|
|
|
|
hub-api:
|
|
build: . # Build the image from the Dockerfile in the current directory
|
|
container_name: hub-api
|
|
restart: always
|
|
ports:
|
|
- "48888:48888" # Map host port to container port
|
|
depends_on:
|
|
- postgres
|
|
- lakefs
|
|
- minio
|
|
environment:
|
|
## S3 Configuration (linking to the 'minio' service)
|
|
- KOHAKU_HUB_S3_PUBLIC_ENDPOINT=http://127.0.0.1:29001
|
|
- KOHAKU_HUB_S3_ENDPOINT=http://minio:9000
|
|
- KOHAKU_HUB_S3_ACCESS_KEY=minioadmin
|
|
- KOHAKU_HUB_S3_SECRET_KEY=minioadmin
|
|
- KOHAKU_HUB_S3_BUCKET=hub-storage
|
|
## LakeFS Configuration (linking to the 'lakefs' service)
|
|
# uncomment the following lines if you want to manually configure LakeFS
|
|
# by default the hub-api docker container will try to setup lakefs automatically
|
|
# -KOHAKU_HUB_LAKEFS_ACCESS_KEY=xxx
|
|
# -KOHAKU_HUB_LAKEFS_SECRET_KEY=xxx
|
|
- KOHAKU_HUB_LAKEFS_ENDPOINT=http://lakefs:28000
|
|
- KOHAKU_HUB_LAKEFS_REPO_NAMESPACE=hf
|
|
## Application Configuration
|
|
- KOHAKU_HUB_BASE_URL=http://127.0.0.1:28080 # Web UI will proxy requests to hub-api, we use hub-ui url here
|
|
- KOHAKU_HUB_DB_BACKEND=postgres
|
|
- KOHAKU_HUB_DATABASE_URL=postgresql://hub:hubpass@postgres:5432/hubdb # Linking to the 'postgres' service
|
|
- KOHAKU_HUB_LFS_THRESHOLD_BYTES=1000000
|
|
- KOHAKU_HUB_LFS_KEEP_VERSIONS=5
|
|
- KOHAKU_HUB_LFS_AUTO_GC=true
|
|
- KOHAKU_HUB_SITE_NAME=KohakuHub
|
|
## SMTP Configuration (Email Verification - Optional)
|
|
- KOHAKU_HUB_SMTP_ENABLED=false
|
|
- KOHAKU_HUB_SMTP_HOST=smtp.gmail.com
|
|
- KOHAKU_HUB_SMTP_PORT=587
|
|
- KOHAKU_HUB_SMTP_USERNAME=
|
|
- KOHAKU_HUB_SMTP_PASSWORD=
|
|
- KOHAKU_HUB_SMTP_FROM=noreply@kohakuhub.local
|
|
- KOHAKU_HUB_SMTP_TLS=true
|
|
## Auth Configuration
|
|
- KOHAKU_HUB_REQUIRE_EMAIL_VERIFICATION=false
|
|
- KOHAKU_HUB_SESSION_SECRET=change-this-to-random-string-in-production
|
|
- KOHAKU_HUB_SESSION_EXPIRE_HOURS=168
|
|
- KOHAKU_HUB_TOKEN_EXPIRE_DAYS=365
|
|
## Admin API Configuration
|
|
- KOHAKU_HUB_ADMIN_ENABLED=true
|
|
- KOHAKU_HUB_ADMIN_SECRET_TOKEN=change-this-to-random-admin-token-in-production
|
|
# ## Storage Quota Configuration (NULL/unlimited = no limit)
|
|
# # Default quotas for new users
|
|
# - KOHAKU_HUB_DEFAULT_USER_PRIVATE_QUOTA_BYTES=unlimited # Unlimited private storage for users
|
|
# - KOHAKU_HUB_DEFAULT_USER_PUBLIC_QUOTA_BYTES=unlimited # Unlimited public storage for users
|
|
# # Default quotas for new organizations
|
|
# - KOHAKU_HUB_DEFAULT_ORG_PRIVATE_QUOTA_BYTES=unlimited # Unlimited private storage for orgs
|
|
# - KOHAKU_HUB_DEFAULT_ORG_PUBLIC_QUOTA_BYTES=unlimited # Unlimited public storage for orgs
|
|
# # Examples (uncomment and modify as needed):
|
|
- KOHAKU_HUB_DEFAULT_USER_PRIVATE_QUOTA_BYTES=10_000_000 # 10MB for user private repos
|
|
- KOHAKU_HUB_DEFAULT_USER_PUBLIC_QUOTA_BYTES=100_000_000 # 20MB for user public repos
|
|
- KOHAKU_HUB_DEFAULT_ORG_PRIVATE_QUOTA_BYTES=10_000_000 # 10MB for org private repos
|
|
- KOHAKU_HUB_DEFAULT_ORG_PUBLIC_QUOTA_BYTES=100_000_000 # 100MB for org public repos
|
|
volumes:
|
|
- ./hub-meta/hub-api:/hub-api-creds
|
|
|
|
minio:
|
|
image: quay.io/minio/minio:latest
|
|
container_name: minio
|
|
command: server /data --console-address ":29000"
|
|
environment:
|
|
- MINIO_ROOT_USER=minioadmin
|
|
- MINIO_ROOT_PASSWORD=minioadmin
|
|
ports:
|
|
- "29001:9000" # S3 API
|
|
- "29000:29000" # Web Console
|
|
volumes:
|
|
- ./hub-storage/minio-data:/data
|
|
- ./hub-meta/minio-data:/root/.minio
|
|
|
|
lakefs:
|
|
image: treeverse/lakefs:latest
|
|
container_name: lakefs
|
|
environment:
|
|
- LAKEFS_DATABASE_TYPE=local
|
|
- LAKEFS_DATABASE_LOCAL_PATH=/var/lakefs/data/metadata.db
|
|
- LAKEFS_BLOCKSTORE_TYPE=s3
|
|
- LAKEFS_BLOCKSTORE_S3_ENDPOINT=http://minio:9000
|
|
- LAKEFS_BLOCKSTORE_S3_FORCE_PATH_STYLE=true
|
|
- LAKEFS_BLOCKSTORE_S3_CREDENTIALS_ACCESS_KEY_ID=minioadmin
|
|
- LAKEFS_BLOCKSTORE_S3_CREDENTIALS_SECRET_ACCESS_KEY=minioadmin
|
|
- LAKEFS_AUTH_ENCRYPT_SECRET_KEY=a_very_secret_key_change_me # IMPORTANT: Change this key
|
|
- LAKEFS_LOGGING_FORMAT=text
|
|
- LAKEFS_LISTEN_ADDRESS=0.0.0.0:28000
|
|
ports:
|
|
- "28000:28000" # lakeFS Web + API
|
|
user: "${UID}:${GID}" # May be crucial for permissions
|
|
depends_on:
|
|
- minio
|
|
volumes:
|
|
- ./hub-meta/lakefs-data:/var/lakefs/data
|
|
- ./hub-meta/lakefs-cache:/lakefs/data/cache
|
|
|
|
postgres:
|
|
image: postgres:15
|
|
container_name: postgres
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_USER=hub
|
|
- POSTGRES_PASSWORD=hubpass
|
|
- POSTGRES_DB=hubdb
|
|
ports:
|
|
- "25432:5432"
|
|
volumes:
|
|
- ./hub-meta/postgres-data:/var/lib/postgresql/data
|
|
|
|
networks:
|
|
default:
|
|
name: hub-net |