我有一个docker-compose.yml配置.其中一个容器是Tomcat服务器,它.war在webapps目录中部署了一些默认文件.
我希望能够传递(覆盖)war由驻留在主机上的某些人部署的存档.我认为最好的方法是以某种方式切换/覆盖启动docker-compose:默认情况下,我想运行war容器内的webapp(文件),但我希望有可能从我的主机安装目录(用于如果需要,在开发/调试期间的例子.
目前,我在我的行中有以下行,docker-compose.yml如果我需要默认值,则会注释掉.
volumes:
# By default, there is the latest version of the application already present in the container
# If you want to provider the container with your own .war file, uncomment the following line
# - ./application/webapps:/usr/local/tomcat/webapps
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法来实现这一目标?