Severian commited on
Commit
d691a45
·
verified ·
1 Parent(s): cd6550a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -1
Dockerfile CHANGED
@@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y \
20
  libmpc-dev \
21
  nodejs \
22
  npm \
 
23
  && rm -rf /var/lib/apt/lists/* \
24
  && pip install --no-cache-dir "poetry==${POETRY_VERSION}"
25
 
@@ -90,7 +91,8 @@ echo "===== Application Startup at $(date "+%Y-%m-%d %H:%M:%S") ====="\n\
90
  # Wait for database\n\
91
  max_tries=30\n\
92
  count=0\n\
93
- while ! pg_isready -h $DB_HOST -p $DB_PORT -U $DB_USERNAME; do\n\
 
94
  echo "Waiting for database connection..."\n\
95
  sleep 2\n\
96
  count=$((count+1))\n\
@@ -100,6 +102,8 @@ while ! pg_isready -h $DB_HOST -p $DB_PORT -U $DB_USERNAME; do\n\
100
  fi\n\
101
  done\n\
102
  \n\
 
 
103
  # Run database migrations\n\
104
  cd /app/api && poetry run python -m flask db upgrade\n\
105
  \n\
 
20
  libmpc-dev \
21
  nodejs \
22
  npm \
23
+ postgresql-client \
24
  && rm -rf /var/lib/apt/lists/* \
25
  && pip install --no-cache-dir "poetry==${POETRY_VERSION}"
26
 
 
91
  # Wait for database\n\
92
  max_tries=30\n\
93
  count=0\n\
94
+ echo "Checking database connection..."\n\
95
+ until PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -p $DB_PORT -U $DB_USERNAME -d $DB_DATABASE -c "SELECT 1" > /dev/null 2>&1; do\n\
96
  echo "Waiting for database connection..."\n\
97
  sleep 2\n\
98
  count=$((count+1))\n\
 
102
  fi\n\
103
  done\n\
104
  \n\
105
+ echo "Database connection successful"\n\
106
+ \n\
107
  # Run database migrations\n\
108
  cd /app/api && poetry run python -m flask db upgrade\n\
109
  \n\