diff --git a/backend/.python-version b/backend/.python-version index 5a7eaff..2b0dbcf 100644 --- a/backend/.python-version +++ b/backend/.python-version @@ -1,2 +1,2 @@ -3.8.10 +3.11.0 diff --git a/backend/Dockerfile b/backend/Dockerfile index 42b5d66..0ef8151 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM python:3.11-slim # Set environment variables ENV DATABASE_URL="postgresql://projecthub:password123@db:5432/projecthub" @@ -10,12 +10,15 @@ EXPOSE 5000 8000 9000 # Install system dependencies RUN apt-get update && apt-get install -y \ - python3 \ - python3-pip \ postgresql-client \ libpq-dev \ - netcat \ + netcat-openbsd \ dos2unix \ + gcc \ + g++ \ + libxml2-dev \ + libxslt1-dev \ + zlib1g-dev \ && rm -rf /var/lib/apt/lists/* # Set working directory @@ -25,8 +28,8 @@ WORKDIR /app COPY requirements.txt . # Upgrade pip and install Python dependencies -RUN pip3 install --upgrade pip setuptools wheel && \ - pip3 install --no-cache-dir -r requirements.txt +RUN pip install --upgrade pip setuptools wheel && \ + pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . diff --git a/backend/docker-entrypoint.sh b/backend/docker-entrypoint.sh index 2e3970d..b57e970 100755 --- a/backend/docker-entrypoint.sh +++ b/backend/docker-entrypoint.sh @@ -11,7 +11,7 @@ attempt=0 while [ $attempt -lt $max_attempts ]; do # Try connecting with netcat or python - if nc -z $DB_HOST 5432 2>/dev/null || python3 -c "import socket; socket.create_connection(('$DB_HOST', 5432), timeout=2)" 2>/dev/null; then + if nc -z $DB_HOST 5432 2>/dev/null || python -c "import socket; socket.create_connection(('$DB_HOST', 5432), timeout=2)" 2>/dev/null; then echo "PostgreSQL is ready on $DB_HOST!" break fi @@ -26,5 +26,5 @@ if [ $attempt -eq $max_attempts ]; then fi # Start the application -exec python3 app.py +exec python app.py diff --git a/backend/requirements.txt b/backend/requirements.txt index d0c1582..64204a4 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,16 +1,17 @@ Flask==1.1.4 Flask-SQLAlchemy==2.3.2 SQLAlchemy==1.4.0 -Flask-CORS==3.0.7 +Flask-CORS==4.0.0 Flask-JWT-Extended==3.13.1 -psycopg2-binary==2.7.4 -PyJWT==1.6.4 +psycopg2-binary==2.9.9 +PyJWT==2.8.0 Werkzeug==1.0.1 python-dotenv==0.10.0 requests==2.20.0 -lxml==4.2.5 -Pillow==5.2.0 -python-magic==0.4.15 -PyYAML==3.13 +lxml==4.9.3 +Pillow==10.0.0 +python-magic==0.4.27 +PyYAML==6.0.1 Jinja2==2.11.3 +MarkupSafe==2.0.1