在Dockerfile中添加mime-support包以确保正确的MIME类型检测,同时在Go代码中显式注册.js、.mjs、.css和.map文件的MIME类型,避免浏览器因Content-Type不正确而拒绝加载静态资源。
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ FROM debian:stable-slim
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ca-certificates tzdata \
|
||||
&& apt-get install -y ca-certificates tzdata mime-support \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
Reference in New Issue
Block a user