diff --git a/bin/create-clients.sh b/bin/create-clients.sh index 346b540..7d702c3 100755 --- a/bin/create-clients.sh +++ b/bin/create-clients.sh @@ -12,13 +12,23 @@ __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -docker-compose run --rm \ +docker_image="oryd/hydra:v1.0.0-beta.9-alpine" +network="auth.reaction.localhost" +hydra_host="hydra.${network}" +hydra_admin_port="4445" +hydra_admin_url="http://${hydra_host}:${hydra_admin_port}" +docker run --rm \ + --interactive \ --volume "${__dir}/wait-for.sh:/usr/local/bin/wait-for.sh" \ - hydra-clients <<'EOF' -set -e + --network "${network}" \ + --env "HYDRA_HOST=${hydra_host}" \ + --env "HYDRA_ADMIN_PORT=${hydra_admin_port}" \ + --env "HYDRA_ADMIN_URL=${hydra_admin_url}" \ + --env "HYDRA_CLIENT_SECRET" \ + --network "${network}" \ + --entrypoint sh \ + "${docker_image}" <<'EOF' /usr/local/bin/wait-for.sh "${HYDRA_HOST}:${HYDRA_ADMIN_PORT}" -# Want to check stderr on failure of the next command so +e -set +e hydra clients create --skip-tls-verify \ --id reaction-next-starterkit \ --secret "${HYDRA_CLIENT_SECRET-CHANGEME}" \ diff --git a/docker-compose.yml b/docker-compose.yml index 58f84e2..b001ee1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,21 +17,6 @@ services: - DATABASE_URL=postgres://hydra:changeme@postgres:5432/hydra?sslmode=disable restart: on-failure - hydra-clients: - image: oryd/hydra:v1.0.0-beta.9-alpine - entrypoint: /bin/sh - depends_on: - - hydra - environment: - HYDRA_HOST: hydra.auth.reaction.localhost - HYDRA_ADMIN_PORT: 4445 - HYDRA_ADMIN_URL: http://hydra.auth.reaction.localhost:4445 - HYDRA_CLIENT_SECRET: - restart: never - networks: - default: - auth: - hydra: image: oryd/hydra:v1.0.0-beta.9-alpine command: serve all --dangerous-force-http @@ -76,7 +61,6 @@ services: volumes: - postgres-data:/var/lib/postgresql/data - # Uncomment the following section to use mysql instead. # mysqld: # image: mysql:5.7