Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI Tutor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Salma Mohammed Hamed
AI Tutor
Commits
472b64a0
Commit
472b64a0
authored
Sep 17, 2025
by
SalmaMohammedHamedMustafa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wait-for-postgres.sh
parent
fbb2d9f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
Dockerfile
self_hosted_env/voice_agent/Dockerfile
+14
-4
wait-for-postgres.sh
self_hosted_env/voice_agent/wait-for-postgres.sh
+20
-0
No files found.
self_hosted_env/voice_agent/Dockerfile
View file @
472b64a0
...
...
@@ -2,13 +2,23 @@ FROM python:3.10-slim
WORKDIR
/app
# Install postgresql-client for pg_isready
RUN
apt-get update
&&
apt-get
install
-y
\
postgresql-client
\
&&
rm
-rf
/var/lib/apt/lists/
*
# Install Python dependencies
COPY
requirements.txt .
RUN
pip
install
--no-cache-dir
-r
requirements.txt
# Copy the startup script and your application code
COPY
. .
#just keep the container running without doing anything
#CMD ["sh", "-c", "while :; do sleep 10; done"]
#run the app automatically when the container starts
CMD
["python", "main.py"]
# Make the script executable
RUN
chmod
+x wait-for-postgres.sh
# Use the script as the entrypoint
ENTRYPOINT
["/app/wait-for-postgres.sh"]
# This is your application's original startup command
CMD
["python", "main.py"]
\ No newline at end of file
self_hosted_env/voice_agent/wait-for-postgres.sh
0 → 100644
View file @
472b64a0
#!/bin/bash
# wait-for-postgres.sh
set
-e
host
=
"postgres"
port
=
"5432"
dbname
=
"
${
POSTGRES_DB
}
"
user
=
"
${
POSTGRES_USER
}
"
password
=
"
${
POSTGRES_PASSWORD
}
"
echo
"Waiting for PostgreSQL..."
until
PGPASSWORD
=
$password
pg_isready
-h
$host
-p
$port
-U
$user
;
do
echo
"PostgreSQL is unavailable - sleeping"
sleep
1
done
echo
"PostgreSQL is up - executing command"
exec
"
$@
"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment