[英]Deploy JEE application from Netbeans to Payara docker image
I'm currently running a traditional development setup on my local machine:我目前正在本地机器上运行传统的开发设置:
db: mariadb数据库:mariadb
app server: payara应用服务器:payara
ide: netbeans ide:netbeans
plus some node docker containers.加上一些节点 docker 容器。
I'm using the Payara plugin in NetBeans to control Payara and deploy my JEE aps directly to the app server.我使用 NetBeans 中的 Payara 插件来控制 Payara 并将我的 JEE 应用程序直接部署到应用程序服务器。 It works like a charm.
它就像一个魅力。
But I would like to run payara and mariadb in docker containers.但我想在 docker 容器中运行 payara 和 mariadb。 I have created my docker images and I can start the db as well as the payara app server without any problems.
我已经创建了我的 docker 图像,我可以毫无问题地启动 db 和 payara 应用程序服务器。 It works.
有用。
I can manually deploy my war file in payara and run the corresponding web app.我可以在 payara 中手动部署我的 war 文件并运行相应的 Web 应用程序。 No problems here.
这里没有问题。 I can ping the db from the dockerized app server.
我可以从 dockerized 应用服务器 ping 数据库。
But the last step in the process is impossible for me to grasp.但是这个过程的最后一步对我来说是不可能掌握的。 How do I deploy the web app directly from NetBeans to my Payara docker container.
如何将 Web 应用程序直接从 NetBeans 部署到我的 Payara docker 容器。
I can't find any documentation on that.我找不到任何文档。 When I add a server to NetBeans I can chose payara server and select remote domain.
当我向 NetBeans 添加服务器时,我可以选择 payara 服务器并选择远程域。 I have an opportunity to click 'docker volume' but I don't know what to enter in 'Host Path' and 'Container Path'.
我有机会单击“docker volume”,但我不知道在“主机路径”和“容器路径”中输入什么。
Is it possble at all to control Payara running in a docker container the same way as when running Payara as a normal app server?是否可以像将 Payara 作为普通应用服务器运行时一样控制在 docker 容器中运行的 Payara?
Kim金
At runtime of the Payara container, there must be a deployments folder where the war file gets copied to.在 Payara 容器运行时,必须有一个部署文件夹,将战争文件复制到该文件夹。
For the containerized Payara you can achieve that in two ways:对于容器化的 Payara,您可以通过两种方式实现:
Build your war file.建立你的战争文件。 Place it besides a Dockerfile.
将它放在 Dockerfile 旁边。 In the Dockerfile have some line like
在 Dockerfile 中有一些类似的行
ADD warfilename.war /payara/deployments
Perform a docker build
and the container will have the application builtin.执行
docker build
,容器将内置应用程序。 I am assuming your warfile's name is 'warfilename.war' and needs to be visible inside the container in the /payara/deployments
folder.我假设您的战争文件的名称是“warfilename.war”,并且需要在
/payara/deployments
文件夹中的容器内可见。
Suppose you have the vanilla Payara container, without your application.假设您有 vanilla Payara 容器,但没有您的应用程序。 Then run it like
然后像这样运行
docker run --name payara -v warfilenamedirectory:/payara/deployments payara:latest
I am assuming your warfile is contained in a directory warfilenamedirectory
and needs to be visible inside the container at /payara/deployments
.我假设您的 warfile 包含在目录
warfilenamedirectory
中,并且需要在/payara/deployments
的容器内可见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.