Skip to content

Commit

Permalink
fix: docker compose migrate (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogomezm authored Dec 22, 2021
1 parent 67c4c60 commit f1599a4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
12 changes: 12 additions & 0 deletions config/keto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: v0.7.0-alpha.1

log:
level: debug

serve:
read:
host: 0.0.0.0
port: 4466
write:
host: 0.0.0.0
port: 4467
28 changes: 19 additions & 9 deletions docker-compose-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
version: '3'
version: '3.2'

services:

keto-migrate:
image: oryd/keto:v0.6.0-alpha.1
image: oryd/keto:v0.7.0-alpha.1
links:
- postgresd:postgresd
- mysqld:mysqld
volumes:
- type: bind
source: ./config
target: /home/ory
environment:
- LOG_LEVEL=debug
- DSN=mysql://root:secret@tcp(mysqld:3306)/mysql&max_conns=20&max_idle_conns=4
command:
migrate sql -e
- DSN=mysql://root:secret@mysqld:3306/mysql&max_conns=20&max_idle_conns=4
command: ["migrate", "up", "-y"]
restart: on-failure

keto:
image: oryd/keto:v0.6.0-alpha.1
image: oryd/keto:v0.7.0-alpha.1
links:
- postgresd:postgresd
- mysqld:mysqld
volumes:
- type: bind
source: ./config
target: /home/ory
ports:
- '4466:4466'
- '4467:4467'
depends_on:
- keto-migrate
environment:
- DSN=mysql://root:secret@tcp(mysqld:3306)/mysql&max_conns=20&max_idle_conns=4
- DSN=mysql://root:secret@mysqld:3306/mysql&max_conns=20&max_idle_conns=4

mysqld:
image: mysql:5.7
Expand Down
17 changes: 12 additions & 5 deletions docker-compose-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,35 @@ version: '3.2'
services:

keto-migrate:
image: oryd/keto:v0.7.0-alpha.0
image: oryd/keto:v0.7.0-alpha.1
links:
- postgresd:postgresd
volumes:
- type: bind
source: .
source: ./config
target: /home/ory
environment:
- LOG_LEVEL=debug
- DSN=postgres://dbuser:secret@postgresd:5432/accesscontroldb?sslmode=disable
command:
migrate sql postgres://dbuser:secret@postgresd:5432/accesscontroldb?sslmode=disable
command: ["migrate", "up", "-y"]
restart: on-failure

keto:
image: oryd/keto:v0.7.0-alpha.0
image: oryd/keto:v0.7.0-alpha.1
links:
- postgresd:postgresd
volumes:
- type: bind
source: ./config
target: /home/ory
ports:
- '4466:4466'
- '4467:4467'
depends_on:
- keto-migrate
environment:
- DSN=postgres://dbuser:secret@postgresd:5432/accesscontroldb?sslmode=disable
restart: on-failure

postgresd:
image: postgres:9.6
Expand Down

0 comments on commit f1599a4

Please sign in to comment.