Skip to content

Commit

Permalink
网关等程序中可能用到了服务名称域名(在多容器时的服务名称),增加 hosts 来让网关等程序解析成功。
Browse files Browse the repository at this point in the history
  • Loading branch information
jack30724 committed Dec 2, 2024
1 parent d97da94 commit d943f69
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions prestart.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/bash

# 定义要添加的主机名和IP 到 /etc/hosts
entries=(
"127.0.0.1 aospace-fileapi"
"127.0.0.1 aospace-redis"
)
# 遍历数组并检查每个条目是否已经存在于 /etc/hosts 中
for entry in "${entries[@]}"; do
if ! grep -qF "$entry" /etc/hosts; then
echo "$entry" >> /etc/hosts
echo "Added: $entry"
else
echo "Already exists: $entry"
fi
done


# 启动 Redis
redis-server --requirepass placeholder_mysecretpassword --appendonly yes --appendfsync everysec --auto-aof-rewrite-percentage 100 --auto-aof-rewrite-min-size 100mb &

Expand Down

0 comments on commit d943f69

Please sign in to comment.