From b483d7d9d8c858fb327fd637c2f2043d0090e15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Lang?= Date: Mon, 6 May 2024 13:45:58 +0000 Subject: [PATCH] Update Devcontainer --- .devcontainer/devcontainer.json | 5 +++-- config/config.exs | 12 ++++++------ config/test.exs | 12 ++++++------ docker-compose.yml | 2 -- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cd0ccef..62b558c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,13 @@ { "name": "jehovakel_ex_event_store", "dockerComposeFile": [ + "../docker-compose.yml", "docker-compose.yml" ], "service": "devcontainer", "workspaceFolder": "/workspace", - // "onCreateCommand": ".devcontainer/bin/onCreateCommand", - // "updateContentCommand": ".devcontainer/bin/updateContentCommand", + "onCreateCommand": ".devcontainer/bin/onCreateCommand", + "updateContentCommand": ".devcontainer/bin/updateContentCommand", "customizations": { "codespaces": { "repositories": { diff --git a/config/config.exs b/config/config.exs index e7ae0e3..697f8c4 100644 --- a/config/config.exs +++ b/config/config.exs @@ -33,20 +33,20 @@ config :jehovakel_ex_event_store, # General Repository configuration config :jehovakel_ex_event_store, Support.JehovakelExRepo, - username: System.get_env("PG_USER") || System.get_env()["USER"], - password: System.get_env("PG_PASSWORD") || "", + username: System.get_env("PG_USER") || "postgres", + password: System.get_env("PG_PASSWORD") || "postgres", port: System.get_env("PG_PORT") || "5432", - hostname: System.get_env("PG_HOST") || "localhost", + hostname: System.get_env("PG_HOST") || "postgres", database: System.get_env("PG_NAME") || "jehovakel_ex_event_store_#{config_env()}", pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), migration_source: "readstore_schema_migrations" config :eventstore, EventStore.Storage, serializer: EventStore.TermSerializer, - username: System.get_env("PG_USER") || System.get_env()["USER"], - password: System.get_env("PG_PASSWORD") || "", + username: System.get_env("PG_USER") || "postgres", + password: System.get_env("PG_PASSWORD") || "postgres", port: System.get_env("PG_PORT") || "5432", - hostname: System.get_env("PG_HOST") || "localhost", + hostname: System.get_env("PG_HOST") || "postgres", database: System.get_env("PG_NAME") || "jehovakel_ex_event_store_#{config_env()}", pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10") diff --git a/config/test.exs b/config/test.exs index 08886bb..0fca423 100644 --- a/config/test.exs +++ b/config/test.exs @@ -7,10 +7,10 @@ config :jehovakel_ex_event_store, # General Repository configuration config :jehovakel_ex_event_store, Support.Repo, adapter: Ecto.Adapters.Postgres, - username: System.get_env("PG_USER") || System.get_env()["USER"], - password: System.get_env("PG_PASSWORD") || "", + username: System.get_env("PG_USER") || "postgres", + password: System.get_env("PG_PASSWORD") || "postgres", port: System.get_env("PG_PORT") || "5432", - hostname: System.get_env("PG_HOST") || "localhost", + hostname: System.get_env("PG_HOST") || "postgres", database: System.get_env("PG_NAME") || "jehovakel_ex_#{config_env()}", # Avoid collisions with eventstore `schema_migrations` relation migration_source: "readstore_schema_migrations", @@ -21,10 +21,10 @@ config :jehovakel_ex_event_store, Support.Repo, config :jehovakel_ex_event_store, JehovakelEx.EventStore, serializer: EventStore.TermSerializer, - username: System.get_env("PG_USER") || System.get_env()["USER"], - password: System.get_env("PG_PASSWORD") || "", + username: System.get_env("PG_USER") || "postgres", + password: System.get_env("PG_PASSWORD") || "postgres", port: System.get_env("PG_PORT") || "5432", - hostname: System.get_env("PG_HOST") || "localhost", + hostname: System.get_env("PG_HOST") || "postgres", database: System.get_env("PG_NAME") || "jehovakel_ex_#{config_env()}", pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), # erhöht die DB-Pool checkout timeouts, so dass die Tests mehr Zeit haben und durchlaufen können diff --git a/docker-compose.yml b/docker-compose.yml index c8f93a4..e247a5d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,6 @@ version: '3' services: postgres: image: postgres:12.9 - ports: - - 5432:5432 environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres