⚠️ Important: Docker Compose update for PostgreSQL / TimescaleDB #116
x0sina
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If you are using PostgreSQL or TimescaleDB with PasarGuard, please update your
docker-compose.ymlto the officially maintained templates below.✅ Recommended Docker Compose files
https://github.com/PasarGuard/scripts/blob/main/pasarguard-timescaledb.yml
https://github.com/PasarGuard/scripts/blob/main/pasarguard-postgresql.yml
These setups include PgBouncer for connection pooling and are tuned for high concurrency and stability.
🔧 Required ENV change (VERY IMPORTANT)
If you are using PgBouncer, you must connect the application to PgBouncer, not directly to PostgreSQL.
➡️ Change your SQLAlchemy database port from
5432to6432in.env:Use asyncpg via PgBouncer like this:
✅ connects to PgBouncer (6432)
5432→ PostgreSQL internal port6432→ PgBouncer port ✅ (this is what PasarGuard must use)Failing to do this may cause:
✅ Notes
depends_on + healthcheckensure correct startup orderIf you have any questions or migration issues, feel free to comment below 👇
اگر از PostgreSQL یا TimescaleDB همراه با PasarGuard استفاده میکنید، لطفاً فایل
docker-compose.ymlخود را با قالبهای رسمی زیر بهروزرسانی کنید.✅ فایلهای پیشنهادی Docker Compose
TimescaleDB
https://github.com/PasarGuard/scripts/blob/main/pasarguard-timescaledb.yml
PostgreSQL
https://github.com/PasarGuard/scripts/blob/main/pasarguard-postgresql.yml
این تنظیمات شامل PgBouncer برای Connection Pooling هستند و برای ترافیک بالا و پایداری بیشتر بهینه شدهاند.
🔧 تغییر ضروری در ENV (بسیار مهم)
اگر از PgBouncer استفاده میکنید، باید اپلیکیشن را به PgBouncer متصل کنید، نه مستقیماً به PostgreSQL.
➡️ پورت دیتابیس SQLAlchemy را در
.envاز5432به6432تغییر دهید:از asyncpg از طریق PgBouncer به این صورت استفاده کنید:
این مقدار به PgBouncer (پورت 6432) متصل میشود. ✅
5432→ پورت داخلی PostgreSQL6432→ پورت PgBouncer ✅ (این پورتی است که PasarGuard باید از آن استفاده کند)اگر این تغییر را اعمال نکنید، ممکن است با مشکلات زیر مواجه شوید:
✅ نکات
depends_on + healthcheckترتیب صحیح بالا آمدن سرویسها را تضمین میکنداگر سوال یا مشکلی در فرآیند مهاجرت دارید، در ادامه پیام بگذارید 👇
Beta Was this translation helpful? Give feedback.
All reactions