Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAM postgres #98

Merged
merged 3 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 116 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 18 additions & 19 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,35 @@ services:

iam:
pull_policy: always
image: ghcr.io/verseghy/iam
image: ghcr.io/verseghy/iam:v3
environment:
DATABASE_URL: mysql://iam:secret@iam-database:3306/iam
DATABASE_URL: postgres://iam:secret@iam-database:5432/iam
ports:
- 3001:3001
depends_on:
iam-migration:
condition: service_completed_successfully

iam-database:
image: docker.io/mysql:8.0
image: docker.io/postgres:16
environment:
MYSQL_DATABASE: iam
MYSQL_USER: iam
MYSQL_PASSWORD: secret
MYSQL_ALLOW_EMPTY_PASSWORD: yes
TZ: Europe/Budapest
POSTGRES_USER: iam
POSTGRES_PASSWORD: secret
POSTGRES_DB: iam
ports:
- 3306:3306
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 1s
timeout: 1s
retries: 100
- 5433:5432
# healthcheck:
# test: ["CMD", "pg_isready", "-U", "iam"]
# interval: 10s
# timeout: 45s
# retries: 10

iam-migration:
pull_policy: always
image: ghcr.io/verseghy/iam-migration
image: ghcr.io/verseghy/iam-migration:v3
environment:
DATABASE_URL: mysql://iam:secret@iam-database:3306/iam
depends_on:
iam-database:
condition: service_healthy
DATABASE_URL: postgres://iam:secret@iam-database:5432/iam
command: ["./iam-migration", "--verbose"]
# depends_on:
# iam-database:
# condition: service_healthy
2 changes: 1 addition & 1 deletion test-utils/src/iam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub async fn get_db() -> &'static libiam::testing::Database {
tokio::sync::OnceCell::const_new();

DB.get_or_init(|| async {
libiam::testing::Database::connect("mysql://iam:[email protected]:3306/iam").await
libiam::testing::Database::connect("postgres://iam:[email protected]:5433/iam").await
})
.await
}
Expand Down
Loading