Tag: static

使用位于另一个泊坞窗容器中的nginx提供静态文件

刚开始,我已经看到了这一点 。 但是他/她使用build ,而我使用image 。 我有一个docker-compose文件,它将我以前制作的图像拖到我的服务器上。 app: restart: always image: some-app-image:latest nginxconfiguration location /static/ { root /data/app/web_interface; <— this exists in some-app-image container } 通常情况下,我会将一个卷装载到包含静态文件的应用程序映像上。 但是,由于应用程序容器本身具有静态文件,因此这变得多余。 所有的nginx容器需要做的是“同行”到应用程序容器中,并提供这些静态文件。 喜欢: location /static/ { root http://app:8000/web_interface; } 要么 location /static/ { root app/web_interface; } 有没有办法从nginx容器中提供位于另一个容器中的静态文件?