File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ WORKDIR /app
77RUN apt-get update \
88 && apt-get install -y --no-install-recommends \
99 build-essential \
10- libpq-dev \
1110 default-libmysqlclient-dev \
1211 pkg-config \
12+ gcc \
13+ python3-dev \
1314 && rm -rf /var/lib/apt/lists/*
1415
1516# Install Python dependencies
@@ -25,7 +26,6 @@ WORKDIR /app
2526RUN apt-get update \
2627 && apt-get install -y --no-install-recommends \
2728 gosu \
28- libpq5 \
2929 default-mysql-client \
3030 && rm -rf /var/lib/apt/lists/*
3131
Original file line number Diff line number Diff line change @@ -23,13 +23,16 @@ def get_engine_options(cls):
2323 }
2424 }
2525 elif 'postgresql' in database_url .lower () or 'postgres' in database_url .lower ():
26- # PostgreSQL-specific settings
26+ # PostgreSQL-specific settings (psycopg3 compatible)
2727 return {
2828 'pool_size' : 10 ,
2929 'max_overflow' : 20 ,
3030 'pool_timeout' : 30 ,
3131 'pool_recycle' : 3600 ,
32- 'pool_pre_ping' : True
32+ 'pool_pre_ping' : True ,
33+ 'connect_args' : {
34+ 'connect_timeout' : 10
35+ }
3336 }
3437 elif 'mysql' in database_url .lower () or 'mariadb' in database_url .lower ():
3538 # MySQL/MariaDB-specific settings
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ Werkzeug==3.1.3
1111requests == 2.32.5
1212
1313# Database drivers
14- psycopg2- binary== 2.9.9
14+ psycopg [ binary,pool ] == 3.2.3
1515PyMySQL == 1.1.1
You can’t perform that action at this time.
0 commit comments