feat: Dockerize and complete project

This commit is contained in:
mohamad
2026-04-27 17:30:08 +03:30
parent 051148ce78
commit 3c10f5c5ed
62 changed files with 5296 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
set -e
echo "Waiting for PostgreSQL at ${POSTGRES_HOST}:${POSTGRES_PORT}..."
until python -c "
import os, psycopg2, sys
try:
psycopg2.connect(
dbname=os.environ.get('POSTGRES_DB', 'tecvico'),
user=os.environ.get('POSTGRES_USER', 'tecvico_user'),
password=os.environ.get('POSTGRES_PASSWORD', ''),
host=os.environ.get('POSTGRES_HOST', 'db'),
port=os.environ.get('POSTGRES_PORT', '5432'),
)
sys.exit(0)
except Exception:
sys.exit(1)
"; do
echo "Database not ready. Retrying in 2 seconds..."
sleep 2
done
echo "PostgreSQL is ready."
echo "Running database migrations..."
python manage.py migrate --noinput
echo "Starting application..."
exec "$@"