diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 737e3d2..461d15b 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -109,12 +109,11 @@ jobs: if [ "$CURRENT_CONTAINER_RUNNING" = "true" ]; then echo "🔄 Performing rolling update..." - # Start new container with temporary name + # Start new container with temporary name (no port mapping needed for health check) docker run -d \ --name portfolio-app-new \ --restart unless-stopped \ --network portfolio_net \ - -p 3001:3000 \ -e NODE_ENV=${{ vars.NODE_ENV }} \ -e LOG_LEVEL=${{ vars.LOG_LEVEL }} \ -e DATABASE_URL=postgresql://portfolio_user:portfolio_pass@postgres:5432/portfolio_db?schema=public \ @@ -133,9 +132,9 @@ jobs: echo "⏳ Waiting for new container to be ready..." sleep 15 - # Health check new container + # Health check new container using docker exec for i in {1..20}; do - if curl -f http://localhost:3001/api/health > /dev/null 2>&1; then + if docker exec portfolio-app-new curl -f http://localhost:3000/api/health > /dev/null 2>&1; then echo "✅ New container is healthy!" break fi