简体   繁体   English

将 JEE 应用程序从 Netbeans 部署到 Payara docker 映像

[英]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,您可以通过两种方式实现:

Backe the application in at container build time在容器构建时支持应用程序

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文件夹中的容器内可见。

Mount the directory hosting the application at container run time在容器运行时挂载托管应用程序的目录

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.

相关问题 从 shell 脚本在 payara micro docker 映像中部署应用程序 - Deploy application in payara micro docker image from shell script 如何将应用程序和资源适配器部署/复制到Payara Docker映像 - How to deploy/copy both an application and resource adapter to Payara Docker image 使用 maven 将 Java EE 应用程序部署到 payara41 docker 容器 - Deploy Java EE application to payara41 docker container using maven 如何在docker-compose中自定义Payara图片 - How to customize Payara image in docker-compose 部署在 Kubernetes 一个 Docker 图像与前端 + 后端应用程序 - Deploy at Kubernetes a Docker Image with Frontend + Backend application 无法在Heroku上部署Laravel应用程序的Docker映像 - Unable to deploy the Docker Image of Laravel application on Heroku 从官方 docker 镜像启动时,payara 完整应用服务器的管理控制台的默认用户名和密码是什么? - What is the default username and password for the administration console of the payara full app server when booted from the official docker image? 使用基本身份验证从注册表部署docker镜像 - Deploy a docker image from a registry with basic auth Heroku 从现有的 docker 镜像部署 - Heroku deploy from existing docker image 将 docker 镜像从 dockerhub 部署到 kub.netes - Deploy docker image from dockerhub to kubenetes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM