Skip to content
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
20 changes: 19 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ x-sentry-defaults: &sentry_defaults
<<: *depends_on-healthy
kafka:
<<: *depends_on-healthy
postgres:
pgbouncer:
<<: *depends_on-healthy
memcached:
<<: *depends_on-default
Expand Down Expand Up @@ -144,6 +144,24 @@ services:
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "sentry-postgres:/var/lib/postgresql/data"
pgbouncer:
image: "edoburu/pgbouncer:v1.24.1-p1"
healthcheck:
<<: *healthcheck_defaults
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
test: ["CMD-SHELL", "psql -U postgres -p 5432 -h 127.0.0.1 -tA -c \"select 1;\" -d postgres >/dev/null"]
depends_on:
postgres:
<<: *depends_on-healthy
environment:
DB_USER: ${POSTGRES_USER:-postgres}
DB_HOST: postgres
DB_NAME: postgres
AUTH_TYPE: trust
POOL_MODE: transaction
ADMIN_USERS: postgres,sentry
MAX_CLIENT_CONN: 10000

kafka:
<<: *restart_policy
image: "confluentinc/cp-kafka:7.6.1"
Expand Down
1 change: 1 addition & 0 deletions install/set-up-and-migrate-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ echo "${_group}Setting up / migrating database ..."
if [[ -z "${SKIP_SENTRY_MIGRATIONS:-}" ]]; then
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
start_service_and_wait_ready postgres
start_service_and_wait_ready pgbouncer

os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian')
if [[ -z $os ]]; then
Expand Down
1 change: 1 addition & 0 deletions sentry-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on the host filesystem. Commands that write files should write them to the '/sen
# Actual invocation that runs the command in the container.
invocation() {
start_service_and_wait_ready postgres
start_service_and_wait_ready pgbouncer
start_service_and_wait_ready redis --wait
$dcr --no-deps -v "$VOLUME_MAPPING" -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1
}
Expand Down
2 changes: 1 addition & 1 deletion sentry/sentry.conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_internal_network():
"NAME": "postgres",
"USER": "postgres",
"PASSWORD": "",
"HOST": "postgres",
"HOST": "pgbouncer",
"PORT": "",
}
}
Expand Down