Skip to content

Self-improving AI Employees for everyone

Remove Redis auto-enable from Docker scripts

trohitg15a3270ad6c3
diff --git a/.env.template b/.env.template
index 60032dc5..58521895 100644
--- a/.env.template
+++ b/.env.template
@@ -35,7 +35,7 @@ DATABASE_POOL_SIZE=5
DATABASE_MAX_OVERFLOW=10
# Cache Configuration (Disabled for development)
-REDIS_ENABLED=false
+REDIS_ENABLED=true
CACHE_TTL=300
# Logging
diff --git a/deploy.sh b/deploy.sh
index f5c6ef52..1c878c4a 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -63,13 +63,9 @@ elif [ -f "${LOCAL_DIR}/server/.env" ]; then
elif [ -f "${LOCAL_DIR}/.env.template" ]; then
echo "No .env found, creating from .env.template..."
scp "${LOCAL_DIR}/.env.template" "${GCP_HOST}:/tmp/${SERVICE_NAME}/.env"
- # Enable Redis for production Docker mode
- ssh ${GCP_HOST} "sed -i 's/^REDIS_ENABLED=false/REDIS_ENABLED=true/' /tmp/${SERVICE_NAME}/.env"
elif [ -f "${LOCAL_DIR}/server/.env.template" ]; then
echo "No .env found, creating from server/.env.template..."
scp "${LOCAL_DIR}/server/.env.template" "${GCP_HOST}:/tmp/${SERVICE_NAME}/.env"
- # Enable Redis for production Docker mode
- ssh ${GCP_HOST} "sed -i 's/^REDIS_ENABLED=false/REDIS_ENABLED=true/' /tmp/${SERVICE_NAME}/.env"
else
echo "Warning: No .env or .env.template found. Using docker-compose environment variables only."
fi
diff --git a/scripts/docker.js b/scripts/docker.js
index 72e6fb31..f2d37ce0 100644
--- a/scripts/docker.js
+++ b/scripts/docker.js
@@ -6,14 +6,14 @@
*/
import { spawn } from 'child_process';
-import { readFileSync, writeFileSync, existsSync, copyFileSync } from 'fs';
+import { readFileSync, existsSync, copyFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, '..');
-// Create .env from template if it doesn't exist, with Docker-specific defaults
+// Create .env from template if it doesn't exist
function ensureEnvFile() {
const envPath = resolve(ROOT, '.env');
if (existsSync(envPath)) return true;
@@ -28,13 +28,6 @@ function ensureEnvFile() {
if (existsSync(templatePath)) {
console.log(`[Docker] Creating .env from ${templatePath.replace(ROOT, '.')}`);
copyFileSync(templatePath, envPath);
-
- // Enable Redis by default for Docker mode
- let content = readFileSync(envPath, 'utf8');
- content = content.replace(/^REDIS_ENABLED\s*=\s*false/m, 'REDIS_ENABLED=true');
- writeFileSync(envPath, content);
- console.log('[Docker] Set REDIS_ENABLED=true for Docker mode');
-
return true;
}
}
@@ -71,12 +64,12 @@ ensureEnvFile();
// Build docker-compose command
const composeArgs = [];
-// Add Redis profile if enabled
+// Add Redis profile if enabled in .env
if (isRedisEnabled()) {
composeArgs.push('--profile', 'redis');
- console.log('[Docker] Redis profile enabled (REDIS_ENABLED=true)');
+ console.log('[Docker] Redis profile enabled (REDIS_ENABLED=true in .env)');
} else {
- console.log('[Docker] Redis profile disabled (REDIS_ENABLED=false or not set)');
+ console.log('[Docker] Redis profile disabled (REDIS_ENABLED=false in .env)');
}
// Add command