#!/bin/bash # Test the fix for container conflicts and environment variables echo "๐Ÿงช Testing the fix..." # Set test environment variables export NODE_ENV=production export LOG_LEVEL=info export NEXT_PUBLIC_BASE_URL=https://dk0.dev export NEXT_PUBLIC_UMAMI_URL=https://analytics.dk0.dev export NEXT_PUBLIC_UMAMI_WEBSITE_ID=b3665829-927a-4ada-b9bb-fcf24171061e export MY_EMAIL=contact@dk0.dev export MY_INFO_EMAIL=info@dk0.dev export MY_PASSWORD=test_password export MY_INFO_PASSWORD=test_info_password export ADMIN_BASIC_AUTH=admin:test_password echo "๐Ÿ”ง Environment variables set:" echo "NODE_ENV: $NODE_ENV" echo "NEXT_PUBLIC_BASE_URL: $NEXT_PUBLIC_BASE_URL" echo "MY_EMAIL: $MY_EMAIL" echo "๐Ÿงน Cleaning up ALL existing containers..." docker compose down --remove-orphans || true docker rm -f portfolio-app portfolio-postgres portfolio-redis || true # Force remove the specific problematic container docker rm -f 4dec125499540f66f4cb407b69d9aee5232f679feecd71ff2369544ff61f85ae || true # Clean up any containers with portfolio in the name docker ps -a --format "{{.Names}}" | grep portfolio | xargs -r docker rm -f || true echo "๐Ÿ”ง Starting database and redis with environment variables..." docker compose up -d postgres redis echo "โณ Waiting for services to be ready..." sleep 10 echo "๐Ÿ“‹ Checking running containers:" docker ps --format "table {{.Names}}\t{{.Status}}" echo "โœ… Test completed!"