私はdocker-compose.yml
の設定をしています。コンテナの1つにTomcatサーバーがあり、デフォルトの.war
というファイルがwebapps
ディレクトリに展開されています。ドッキングステーションにボリュームを条件付きで取り付けます
war
アーカイブを、ホストマシン上のいくつかによって展開する(上書きする)能力が必要です。私は最良の方法は、何らかの形でスイッチを入れ替えることです/ docker-compose
:デフォルトでは、コンテナの中にあるwebapp(war
ファイル)を実行したいのですが、私のホストからディレクトリをマウントする可能性があります。 (例えば、開発/デバッグの際に)必要に応じて。
現時点では、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
これを実現する方法はありますか?