admin-ui ng转发域名增加
This commit is contained in:
+13
-1
@@ -1,3 +1,15 @@
|
||||
FROM docker.m.daocloud.io/nginx:alpine
|
||||
FROM nginx:alpine
|
||||
COPY default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY ssl /etc/nginx/ssl
|
||||
|
||||
# 启动时自动获取宿主机内网 IP,替换 __API_HOST__ 占位符(与 admin-ui 同方案,可用 API_HOST 环境变量覆盖)
|
||||
RUN printf '%s\n' \
|
||||
'#!/bin/sh' \
|
||||
'set -e' \
|
||||
'if [ -n "$API_HOST" ]; then' \
|
||||
' HOST_IP="$API_HOST"' \
|
||||
'else' \
|
||||
' HOST_IP=$(route -n 2>/dev/null | grep "^0.0.0.0" | tr -s " " | cut -d " " -f2)' \
|
||||
'fi' \
|
||||
'sed -i "s/__API_HOST__/$HOST_IP/g" /etc/nginx/conf.d/default.conf' \
|
||||
> /docker-entrypoint.d/01-set-api-host.sh && chmod +x /docker-entrypoint.d/01-set-api-host.sh
|
||||
|
||||
Reference in New Issue
Block a user