-
Notifications
You must be signed in to change notification settings - Fork 18
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
Make PostgreSQL and Redis connection strings configurable #627
base: main
Are you sure you want to change the base?
Changes from all commits
1cc8e7b
0c50df0
b5b6a51
45e0312
a017ec6
b0c3243
8a748e6
686b551
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,18 @@ services: | |
# Possible values: amd64 or arm64 | ||
# - ARCH=amd64 | ||
- REDIS_URL=redis://redis:6379/0 | ||
# Allow custom PostgreSQL connection string | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@write-postgres:5432/${POSTGRES_DB} | ||
|
||
write-postgres: | ||
image: postgres:latest | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
|
@@ -34,18 +41,21 @@ services: | |
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres # Ensure consistency | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
redis: | ||
image: redis:latest | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
gatewayd: | ||
image: gatewaydio/gatewayd:latest | ||
command: | ||
|
@@ -65,6 +75,8 @@ services: | |
# https://docs.gatewayd.io/using-gatewayd/configuration#environment-variables | ||
- GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432 | ||
- GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432 | ||
# Use the connection string set in install_plugins | ||
- POSTGRES_URL=${POSTGRES_URL} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not used anywhere in the |
||
# - GATEWAYD_LOGGERS_DEFAULT_LEVEL=debug | ||
ports: | ||
# GatewayD server for PostgreSQL clients to connect to | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ actionRedis: | |||||
enabled: false | ||||||
|
||||||
# if enabled, the url and channel are used to connect to the Redis server. | ||||||
address: localhost:6379 | ||||||
address: ${REDIS_URL} # Use environment variable for Redis URL | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change this to the following, so that it gets replaced by the value of the
Suggested change
|
||||||
channel: gatewayd-actions | ||||||
|
||||||
# The policy is a list of policies to apply to the signals received from the plugins. | ||||||
|
@@ -72,7 +72,7 @@ plugins: | |||||
env: | ||||||
- MAGIC_COOKIE_KEY=GATEWAYD_PLUGIN | ||||||
- MAGIC_COOKIE_VALUE=5712b87aa5d7e9f9e9ab643e6603181c5b796015cb1c09d6f5ada882bf2a1872 | ||||||
- REDIS_URL=redis://localhost:6379/0 | ||||||
- REDIS_URL=${REDIS_URL} # Use environment variable for Redis URL | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing these will make this file unusable if someone tries to use it outside Docker and docker-compose. Hence, you should change the |
||||||
- EXPIRY=1h | ||||||
# - DEFAULT_DB_NAME=postgres | ||||||
- METRICS_ENABLED=True | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary. Explained why below.