Switched postgres for sqlite

This commit is contained in:
David Allen 2024-02-25 08:43:09 -07:00
parent 4f7ad29e0d
commit 6d482cc60f
No known key found for this signature in database
GPG key ID: 1D2A29322FBB6FCB
4 changed files with 45 additions and 110 deletions

View file

@ -6,137 +6,103 @@ networks:
external: true
volumes:
postgres-data:
kratos-sqlite:
hydra-sqlite:
services:
postgres: # Postgres
image: postgres:11.5-alpine
container_name: postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_MULTIPLE_DATABASES: hydradb:hydra-user:hydra,kratosdb:kratos-user:kratos
volumes:
- postgres-data:/var/lib/postgresql/data
- ./pg-init:/docker-entrypoint-initdb.d
networks:
- internal
ports:
- 5432:5432
healthcheck:
test: ["CMD", "pg_isready", "-d", "postgres", "-U", "postgres"]
interval: 10s
timeout: 10s
retries: 5
hydra:
image: oryd/hydra:v2.2.0-rc.3
image: oryd/hydra:v2.2.0
ports:
- "4444:4444" # Public port
- "4445:4445" # Admin port
- "5555:5555" # Port for hydra token user
command: serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- type: volume
source: hydra-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./configs/hydra
target: /etc/config/hydra
environment:
- DSN=postgres://hydra-user:hydra@postgres:5432/hydradb?sslmode=disable&max_conns=20&max_idle_conns=4
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
restart: unless-stopped
depends_on:
hydra-migrate:
condition: service_completed_successfully
- hydra-migrate
networks:
- internal
hydra-migrate:
image: oryd/hydra:v2.2.0-rc.3
image: oryd/hydra:v2.2.0
environment:
- DSN=postgres://hydra-user:hydra@postgres:5432/hydradb?sslmode=disable&max_conns=20&max_idle_conns=4
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- type: volume
source: hydra-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./configs/hydra
target: /etc/config/hydra
restart: on-failure
networks:
- internal
depends_on:
postgres:
condition: service_healthy
consent:
environment:
- HYDRA_ADMIN_URL=http://hydra:4445
- KRATOS_ADMIN_URL=http://kratos:4434
- LISTEN_ADDRESS=:3001
image: oryd/hydra-login-consent-node:v2.2.0-rc.3
image: oryd/hydra-login-consent-node:v2.2.0
ports:
- "3001:3001"
restart: unless-stopped
networks:
- internal
kratos:
image: oryd/kratos:latest
container_name: kratos
hostname: kratos
ports:
- "4433:4433" # public
- "4434:4434" # admin
command: serve -c /etc/config/kratos/kratos.yml all --dev --watch-courier
volumes:
- type: bind
source: ./configs/kratos
target: /etc/config/kratos
environment:
- DSN=postgres://kratos-user:kratos@postgres:5432/kratosdb?sslmode=disable&max_conns=20&max_idle_conns=4
- USER_ID=1000
- GROUP_ID=1000
- LOG_LEVEL=trace
restart: unless-stopped
depends_on:
kratos-migrate:
condition:
service_completed_successfully
postgres:
condition:
service_healthy
networks:
- internal
kratos-migrate:
image: oryd/kratos:latest
container_name: kratos-migrate
image: oryd/kratos:v1.1.0
environment:
- DSN=postgres://kratos-user:kratos@postgres:5432/kratosdb?sslmode=disable&max_conns=20&max_idle_conns=4
- USER_ID=1000
- GROUP_ID=1000
user: "${USER_ID}:${GROUP_ID}"
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
volumes:
- type: volume
source: kratos-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./configs/kratos
target: /etc/config/kratos
command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes
restart: on-failure
depends_on:
postgres:
condition: service_healthy
networks:
- internal
kratos-selfservice-ui-node:
image: oryd/kratos-selfservice-ui-node:latest
image: oryd/kratos-selfservice-ui-node:v1.1.0
environment:
- PORT=4455
- SECURITY_MODE=
- HYDRA_ADMIN_URL=http://127.0.0.1:4445/
- KRATOS_PUBLIC_URL=http://kratos:4433/
- KRATOS_BROWSER_URL=http://127.0.0.1:4433/
- COOKE_SECRET=1234567890
- CSRF_COOKIE_NAME=_OPENCHAMI-CSRF
- CSRF_COOKIE_SECRET=OCHAMI1234
- COOKIE_SECRET=testTESTtestTESTtestTEST
networks:
- internal
restart: on-failure
kratos:
depends_on:
- kratos-migrate
image: oryd/kratos:v1.1.0
ports:
- "4455:4455"
- '4433:4433' # public
- '4434:4434' # admin
restart: unless-stopped
environment:
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
- LOG_LEVEL=trace
command: serve -c /etc/config/kratos/kratos.yml --dev --watch-courier
volumes:
- type: volume
source: kratos-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./configs/kratos
target: /etc/config/kratos
networks:
- internal
mailslurper:
image: oryd/mailslurper:latest-smtps
ports: