mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-12 09:17:44 +02:00
use docker compose to test keycloak
This commit is contained in:
1 parent
369b50d04b
commit
45ecf2cfe0
16 files changed
+973
-2386
No files matched your search
+103
-62
@@ -1,121 +1,162 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Keycloak OIDC Provider
|
||||
# Keycloak Identity Provider
|
||||
keycloak:
|
||||
image: quay.io/keycloak/keycloak:26.0.7
|
||||
container_name: keycloak-iam-test
|
||||
hostname: keycloak
|
||||
environment:
|
||||
KEYCLOAK_ADMIN: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: admin123
|
||||
KC_HTTP_PORT: 8080
|
||||
KC_HOSTNAME_STRICT: false
|
||||
KC_HOSTNAME_STRICT_HTTPS: false
|
||||
KC_HTTP_ENABLED: true
|
||||
KC_HEALTH_ENABLED: true
|
||||
KC_BOOTSTRAP_ADMIN_USERNAME: admin
|
||||
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
|
||||
KC_HTTP_ENABLED: "true"
|
||||
KC_HOSTNAME_STRICT: "false"
|
||||
KC_HOSTNAME_STRICT_HTTPS: "false"
|
||||
KC_HTTP_RELATIVE_PATH: /
|
||||
ports:
|
||||
- "8080:8080"
|
||||
command:
|
||||
- start-dev
|
||||
- --import-realm
|
||||
volumes:
|
||||
- ./keycloak-realm.json:/opt/keycloak/data/import/realm.json:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
command: start-dev
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
|
||||
# SeaweedFS Master
|
||||
seaweedfs-master:
|
||||
weed-master:
|
||||
image: chrislusf/seaweedfs:latest
|
||||
container_name: seaweedfs-master-iam
|
||||
container_name: weed-master
|
||||
hostname: weed-master
|
||||
ports:
|
||||
- "9333:9333"
|
||||
- "19333:19333"
|
||||
command: master -ip=seaweedfs-master -mdir=/data -volumeSizeLimitMB=50
|
||||
command: "master -ip=weed-master -port=9333 -mdir=/data"
|
||||
volumes:
|
||||
- seaweedfs-master-data:/data
|
||||
- master-data:/data
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:9333/cluster/status"]
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9333/cluster/status"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
start_period: 10s
|
||||
|
||||
# SeaweedFS Volume Server
|
||||
seaweedfs-volume:
|
||||
weed-volume:
|
||||
image: chrislusf/seaweedfs:latest
|
||||
container_name: seaweedfs-volume-iam
|
||||
container_name: weed-volume
|
||||
hostname: weed-volume
|
||||
ports:
|
||||
- "8080:8080"
|
||||
command: volume -ip=seaweedfs-volume -port=8080 -mserver=seaweedfs-master:9333 -dir=/data
|
||||
- "18080:18080"
|
||||
command: "volume -ip=weed-volume -port=8080 -dir=/data -mserver=weed-master:9333 -dataCenter=dc1 -rack=rack1"
|
||||
volumes:
|
||||
- seaweedfs-volume-data:/data
|
||||
- volume-data:/data
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
depends_on:
|
||||
seaweedfs-master:
|
||||
weed-master:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/status"]
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/status"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
start_period: 10s
|
||||
|
||||
# SeaweedFS Filer
|
||||
seaweedfs-filer:
|
||||
weed-filer:
|
||||
image: chrislusf/seaweedfs:latest
|
||||
container_name: seaweedfs-filer-iam
|
||||
container_name: weed-filer
|
||||
hostname: weed-filer
|
||||
ports:
|
||||
- "8888:8888"
|
||||
- "18888:18888"
|
||||
command: filer -ip=seaweedfs-filer -master=seaweedfs-master:9333
|
||||
command: "filer -ip=weed-filer -port=8888 -master=weed-master:9333 -defaultStoreDir=/data"
|
||||
volumes:
|
||||
- filer-data:/data
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
depends_on:
|
||||
seaweedfs-master:
|
||||
weed-master:
|
||||
condition: service_healthy
|
||||
weed-volume:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8888/"]
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8888/status"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
start_period: 10s
|
||||
|
||||
# SeaweedFS S3 Gateway with IAM
|
||||
seaweedfs-s3:
|
||||
build:
|
||||
context: ../../..
|
||||
dockerfile: test/s3/iam/Dockerfile.s3
|
||||
container_name: seaweedfs-s3-iam
|
||||
# SeaweedFS S3 API with IAM
|
||||
weed-s3:
|
||||
image: ${SEAWEEDFS_IMAGE:-chrislusf/seaweedfs:latest}
|
||||
container_name: weed-s3
|
||||
hostname: weed-s3
|
||||
ports:
|
||||
- "8333:8333"
|
||||
environment:
|
||||
- KEYCLOAK_URL=http://keycloak:8080
|
||||
command: s3 -port=8333 -filer=seaweedfs-filer:8888 -iam.config=/etc/seaweedfs/iam_config.json
|
||||
WEED_FILER: "weed-filer:8888"
|
||||
WEED_IAM_CONFIG: "/config/iam_config.json"
|
||||
WEED_S3_CONFIG: "/config/test_config.json"
|
||||
GLOG_v: "3"
|
||||
command: >
|
||||
sh -c "
|
||||
echo 'Waiting for dependencies...' &&
|
||||
sleep 10 &&
|
||||
echo 'Starting S3 API with IAM...' &&
|
||||
weed -v=3 s3 -ip=weed-s3 -port=8333
|
||||
-filer=weed-filer:8888
|
||||
-config=/config/test_config.json
|
||||
-iam.config=/config/iam_config.json
|
||||
"
|
||||
volumes:
|
||||
- ./iam_config_docker.json:/etc/seaweedfs/iam_config.json:ro
|
||||
- ./iam_config.json:/config/iam_config.json:ro
|
||||
- ./test_config.json:/config/test_config.json:ro
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
depends_on:
|
||||
weed-filer:
|
||||
condition: service_healthy
|
||||
keycloak:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8333"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
# Keycloak Setup Service
|
||||
keycloak-setup:
|
||||
image: alpine/curl:latest
|
||||
container_name: keycloak-setup
|
||||
volumes:
|
||||
- ./setup_keycloak_docker.sh:/setup.sh:ro
|
||||
- .:/workspace:rw
|
||||
working_dir: /workspace
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
depends_on:
|
||||
keycloak:
|
||||
condition: service_healthy
|
||||
seaweedfs-filer:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8333/"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- seaweedfs-iam
|
||||
command: >
|
||||
sh -c "
|
||||
apk add --no-cache bash jq &&
|
||||
chmod +x /setup.sh &&
|
||||
/setup.sh
|
||||
"
|
||||
|
||||
volumes:
|
||||
seaweedfs-master-data:
|
||||
seaweedfs-volume-data:
|
||||
master-data:
|
||||
volume-data:
|
||||
filer-data:
|
||||
|
||||
networks:
|
||||
seaweedfs-iam:
|
||||
driver: bridge
|
||||
driver: bridge
|
||||
Reference in new issue
Block a user