-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose-nabat-mock.yml
More file actions
41 lines (40 loc) · 1.92 KB
/
Copy pathdocker-compose-nabat-mock.yml
File metadata and controls
41 lines (40 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
services:
keycloak:
image: quay.io/keycloak/keycloak:latest
command: ["start-dev", "--import-realm"]
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
KC_HEALTH_ENABLED: "true"
# Mirrors production's /auth/realms/NABAT/... path shape
KC_HTTP_RELATIVE_PATH: /auth
# Pin the reported hostname+port so issued tokens always carry the same `iss`, whether
# requested via the browser (localhost:8081) or from another container (keycloak:8080).
# A bare hostname isn't enough here - Keycloak resolves scheme/port from the actual
# request unless given a full URL.
KC_HOSTNAME: http://localhost:8081/auth
healthcheck:
# No curl/wget in the keycloak image; probe the management health endpoint via bash's /dev/tcp
test: ['CMD-SHELL', 'exec 3<>/dev/tcp/localhost/9000 && echo -e "GET /auth/health/ready HTTP/1.1\r\nhost: localhost\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep -m 1 status | grep -m 1 UP']
start_period: 30s
start_interval: 2s
ports:
- 8081:8080
volumes:
- ./dev/nabat_mock/NABAT-realm.json:/opt/keycloak/data/import/NABAT-realm.json:ro
# Stands in for NABat's GraphQL API (BATAI_NABAT_API_URL), scoped to the
# single-recording fetch flow. See dev/nabat_mock/mock_server.py. Never actually
# connects to minio (presigning is local signing), so no depends_on is needed here.
nabat-mock:
build:
context: ./dev/nabat_mock
environment:
# Must be a host the celery worker downloading the presigned URL can resolve:
# the compose-network name if celery also runs in Docker (the default), or
# "localhost:9000" if celery runs natively - export an override before `up`.
MINIO_ENDPOINT: ${MINIO_ENDPOINT:-minio:9000}
MINIO_ACCESS_KEY: minioAccessKey
MINIO_SECRET_KEY: minioSecretKey
MINIO_BUCKET: nabat-mock
ports:
- 8082:8082