4

docker 构建 nextjs 镜像,运行容器时不能应用挂载的 .env 文件

 9 months ago
source link: https://www.v2ex.com/t/1000566
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  问与答

docker 构建 nextjs 镜像,运行容器时不能应用挂载的 .env 文件

  Dcynsd · 1 小时 17 分钟前 · 144 次点击

在使用 Dockerfile 构建完镜像,运行容器时,发现不能替换环境变量,无论使用 -e 替换,还是直接挂载 .env 文件。

网上找了下问题,说是在构建期间已经设置好了,请问有什么好的办法解决吗?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK