浏览代码

fix : specify the default hostname if docker builds with a proxy

gtoxlili 1 年之前
父节点
当前提交
707c1a2f7e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Dockerfile

+ 3 - 0
Dockerfile

@@ -41,6 +41,9 @@ COPY --from=builder /app/.next/server ./.next/server
 EXPOSE 3000
 
 CMD if [ -n "$PROXY_URL" ]; then \
+        if [ -z "$HOSTNAME" ]; then
+          HOSTNAME="127.0.0.1"
+        fi; \
         protocol=$(echo $PROXY_URL | cut -d: -f1); \
         host=$(echo $PROXY_URL | cut -d/ -f3 | cut -d: -f1); \
         port=$(echo $PROXY_URL | cut -d: -f3); \