Skip to content

Commit 1bf12c2

Browse files
committed
Revert "[redis]: check and start local redis"
This reverts commit b8011ea.
1 parent e000753 commit 1bf12c2

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

app/.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ DB_PORT=3306
99

1010
ADMIN_USERNAME=admin
1111
ADMIN_PASSWORD=admin
12-
13-
REDIS_HOST=localhost
14-
REDIS_PORT=6379
15-
REDIS_PASSWORD=

docker-entrypoint.sh

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -57,46 +57,6 @@ check_php_fpm() {
5757
log_error "Failed to start PHP-FPM after $max_attempts attempts"
5858
}
5959

60-
check_redis() {
61-
log_info "Checking Redis connection..."
62-
local max_attempts=5
63-
local attempt=0
64-
local redis_host=${REDIS_HOST:-localhost}
65-
local redis_port=${REDIS_PORT:-6379}
66-
local redis_password=${REDIS_PASSWORD:-""}
67-
68-
while [ $attempt -lt $max_attempts ]; do
69-
if [ -n "$redis_password" ]; then
70-
if redis-cli -h $redis_host -p $redis_port -a $redis_password ping 2>/dev/null | grep -q "PONG"; then
71-
log_success "Redis connection successful"
72-
return 0
73-
fi
74-
else
75-
if redis-cli -h $redis_host -p $redis_port ping 2>/dev/null | grep -q "PONG"; then
76-
log_success "Redis connection successful"
77-
return 0
78-
fi
79-
fi
80-
81-
log_info "Redis not responding... (Attempt $((attempt+1))/$max_attempts)"
82-
83-
if [ "$redis_host" = "localhost" ] || [ "$redis_host" = "127.0.0.1" ]; then
84-
log_info "Attempting to start Redis locally..."
85-
if command -v redis-server >/dev/null 2>&1; then
86-
redis-server --daemonize yes
87-
log_info "Redis server started"
88-
else
89-
log_info "Redis server not installed, cannot start automatically"
90-
fi
91-
fi
92-
93-
sleep 3
94-
attempt=$((attempt+1))
95-
done
96-
97-
log_error "Failed to connect to Redis after $max_attempts attempts"
98-
}
99-
10060
echo -e "\n${YELLOW}Lerama: Starting${NC}\n"
10161

10262
# Set timezone
@@ -129,9 +89,6 @@ DB_USER=${MYSQL_USERNAME:-root}
12989
DB_PASS=${MYSQL_PASSWORD:-root}
13090
ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
13191
ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
132-
REDIS_HOST=${REDIS_HOST:-localhost}
133-
REDIS_PORT=${REDIS_PORT:-6379}
134-
REDIS_PASSWORD=${REDIS_PASSWORD:-}
13592
EOL
13693

13794
log_success "Environment variables set in /app/.env"
@@ -205,10 +162,6 @@ if [ ! -d /var/run/php ]; then
205162
log_success "PHP-FPM directory created"
206163
fi
207164

208-
# Check Redis connection
209-
log_info "Checking Redis service..."
210-
check_redis
211-
212165
echo -e "\n${GREEN}Lerama: Initialized ===${NC}\n"
213166

214167
wait -n

0 commit comments

Comments
 (0)