build: 移除不必要的Nginx配置和启动命令
This commit is contained in:
parent
3c6bb106f6
commit
a52db900e0
@ -1,5 +1,7 @@
|
|||||||
FROM jmal/nginx-drawio:latest
|
FROM jmal/nginx-drawio:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache gettext
|
||||||
|
|
||||||
COPY nginx/nginx.conf.no_office.template /etc/nginx/nginx.conf.no_office.template
|
COPY nginx/nginx.conf.no_office.template /etc/nginx/nginx.conf.no_office.template
|
||||||
COPY nginx/nginx.conf.template /etc/nginx/nginx.conf.template
|
COPY nginx/nginx.conf.template /etc/nginx/nginx.conf.template
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# 使用 getent 检查是否可以解析 office 容器的 IP
|
# ... 其余内容保持不变 ...
|
||||||
if getent hosts office &> /dev/null; then
|
if getent hosts office &> /dev/null; then
|
||||||
# 使用包含 office 的 Nginx 配置
|
|
||||||
cp /etc/nginx/nginx.conf.template /etc/nginx/nginx.conf
|
cp /etc/nginx/nginx.conf.template /etc/nginx/nginx.conf
|
||||||
else
|
else
|
||||||
# 使用不包含 office 的 Nginx 配置
|
|
||||||
cp /etc/nginx/nginx.conf.no_office.template /etc/nginx/nginx.conf
|
cp /etc/nginx/nginx.conf.no_office.template /etc/nginx/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
envsubst '${API_URL} ${API_OFFICE_URL}' < /var/www/public/config.js.template > /var/www/public/config.js
|
envsubst '${API_URL} ${API_OFFICE_URL}' < /var/www/public/config.js.template > /var/www/public/config.js
|
||||||
|
|
||||||
# 循环检查,直到 jmalcloud 主机名可以被成功解析
|
|
||||||
# 使用 getent hosts 是比 ping 更可靠的方式,因为它直接查询名称服务
|
|
||||||
while ! getent hosts jmalcloud > /dev/null 2>&1; do
|
while ! getent hosts jmalcloud > /dev/null 2>&1; do
|
||||||
echo "jmalcloud is not yet resolvable, waiting 2 seconds..."
|
echo "jmalcloud is not yet resolvable, waiting 2 seconds..."
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user