Skip to content

Commit

Permalink
chore: adding hydra to quickstart (#3297)
Browse files Browse the repository at this point in the history
* chore: adding hydra to quickstart

* chore: updating docker-compose

* chore: more time needed

---------

Co-authored-by: Nicolas Burtey <[email protected]>
  • Loading branch information
nicolasburtey and Nicolas Burtey authored Oct 3, 2023
1 parent 150b68b commit b8d62c2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
integration:
name: Bats tests
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 18
steps:
- name: Setup BATS
uses: mig4/setup-bats@v1
Expand Down
15 changes: 8 additions & 7 deletions core/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,32 +424,33 @@ services:
image: postgres:14.1
environment:
POSTGRES_PASSWORD: postgres

hydra:
image: oryd/hydra:v2.1.2
ports: []
extra_hosts: []
command: serve -c /home/ory/hydra.yml all --dev
volumes:
- type: bind
source: dev/ory
target: /home/ory
- ${HOST_PROJECT_PATH:-.}/dev/ory:/home/ory
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
restart: unless-stopped
depends_on:
- hydra-migrate
- postgresdhydra
ports: []

hydra-migrate:
image: oryd/hydra:v2.1.2
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command: migrate -c /home/ory/hydra.yml sql -e --yes
volumes:
- type: bind
source: dev/ory
target: /home/ory
- ${HOST_PROJECT_PATH:-.}/dev/ory:/home/ory

restart: on-failure
depends_on:
- postgresdhydra

postgresdhydra:
image: postgres:14.1
environment:
Expand Down
18 changes: 8 additions & 10 deletions docs/hydra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ resource "hydra_oauth2_client" "example" {
token_endpoint_auth_method = "none"
}

output "example_client_id" {
description = "The client ID of the example OAuth2 client."
value = hydra_oauth2_client.example.client_id
output "blink_app_client_id" {
value = hydra_oauth2_client.example.client_id
}

output "example_client_secret" {
description = "The client secret of the example OAuth2 client."
value = hydra_oauth2_client.example.client_secret
sensitive = true
output "blink_app_client_secret" {
value = hydra_oauth2_client.example.client_secret
sensitive = true
}

resource "hydra_oauth2_client" "example2" {
client_name = "example2"
resource "hydra_oauth2_client" "blink_app" {
client_name = "blink_app"
grant_types = ["client_credentials"]
redirect_uris = ["http://localhost:8080/callback"]
response_types = ["token"]
token_endpoint_auth_method = "client_secret_basic"
scopes = ["editor"]
}
7 changes: 6 additions & 1 deletion quickstart/docker-compose.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- stablesats
- svix
- svix-pg
- hydra
restart: on-failure:10

#! Proxies
Expand All @@ -37,6 +38,10 @@ services:
kratos: #@ data.values.services["kratos"]
kratos-pg: #@ data.values.services["kratos-pg"]

hydra: #@ data.values.services["hydra"]
hydra-migrate: #@ data.values.services["hydra-migrate"]
postgresdhydra: #@ data.values.services["postgresdhydra"]

galoy:
#@ if galoy_image_digest == "local":
build:
Expand Down Expand Up @@ -140,7 +145,7 @@ services:
#@overlay/match when=1
volumes:
#@overlay/match by=overlay.all, expects="0+"
#@overlay/replace via=lambda left, right: left.replace("HOST_PROJECT_PATH:-.}", "HOST_PROJECT_PATH:-.}/${GALOY_QUICKSTART_PATH:-vendor/galoy-quickstart}")
#@overlay/replace via=lambda left, right: str(left).replace("HOST_PROJECT_PATH:-.}", "HOST_PROJECT_PATH:-.}/${GALOY_QUICKSTART_PATH:-vendor/galoy-quickstart}")
- REPLACED

#@overlay/match by=overlay.all
Expand Down
31 changes: 31 additions & 0 deletions quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- stablesats
- svix
- svix-pg
- hydra
restart: on-failure:10
apollo-router:
image: ghcr.io/apollographql/router:v1.25.0
Expand Down Expand Up @@ -63,6 +64,36 @@ services:
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=default
hydra:
image: oryd/hydra:v2.1.2
command: serve -c /home/ory/hydra.yml all --dev
volumes:
- yamlfragment(*yamlmeta.Map)
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
restart: unless-stopped
depends_on:
- hydra-migrate
- postgresdhydra
ports:
- 4444:4444
- 4445:4445
hydra-migrate:
image: oryd/hydra:v2.1.2
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command: migrate -c /home/ory/hydra.yml sql -e --yes
volumes:
- yamlfragment(*yamlmeta.Map)
restart: on-failure
depends_on:
- postgresdhydra
postgresdhydra:
image: postgres:14.1
environment:
- POSTGRES_USER=hydra
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=hydra
galoy:
image: us.gcr.io/galoy-org/galoy-app@sha256:e40668b0abae303d278182946bebfb9001caee6003867fedfb89b40fdd6b704d
command:
Expand Down

0 comments on commit b8d62c2

Please sign in to comment.