Java: Start WAS with Docker and deploy your own application

At the beginning

I started WebSphere on Docker and tried to deploy my own application

Docker settings

Creating a Dockerfile

Source on GitHub Image uses "websphere-liberty" If you place the war in / config / drops /, it will be deployed automatically, so set the war in the local folder where the war built with gradle is placed to be copied to the remote / config / drops /.

docker-compose.yml Source on GitHub There is nothing to consider

Creating a web module

Create gradle file

Source on GitHub Specify war for plugin and set the dependencies required for build

Java module

Source on GitHub

The response type of the app created in About SImple JAX-RS apps is changed to PLAN_TEXT.

Build-to-deploy flow

  1. Create a war file with gradle's war task
  2. Create a virtual environment on docker with docker-compose up -d (If it doesn't work, clear the cache with docker-compose build --no-cache)
  3. Go to http: // localhost / MyWebApp / sample / Area (WAS seems to need to specify the name of the war file as the context root)

Execution result

image.png

Is displayed, it is confirmed that WAS is running safely!

Recommended Posts

Java: Start WAS with Docker and deploy your own application
Deploy your application with VPC + EC2 + Docker.
Deploy a Docker application with Greengrass
Prepare a scraping environment with Docker and Java
Rails deploy with Docker
[Java] Sort ArrayList with elements of your own class
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (5)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (6)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (3)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (2)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (1)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (4)
Deploy with EC2 / Docker / Laravel
Create your own Java annotations
Deploy your application to WildFly
Web application built with docker (1)
Easily convert Java application to Docker container with Jib ~ Build with gradle and register in local repository
Comparison of WEB application development with Rails and Java Servlet + JSP
Build apache7.4 + mysql8 environment with Docker (with initial data) (your own memo)
Image Spring Boot app using jib-maven-plugin and start it with Docker
Make your own sampler with JMeter
Use java with MSYS and Cygwin
Distributed tracing with OpenCensus and Java
Install Java and Tomcat with Ansible
Easily Docker Java applications with Jib
Use JDBC with Java and Scala.
Hello World with Docker and C
Make your own persistence FW (Java)
Handle your own annotations in Java
[SRE / Docker] Start control with Dockerize
Output PDF and TIFF with Java 8
Web application creation with Nodejs with Docker
mysql doesn't start up with docker.
Java, arrays to start with beginners
Microservices With Docker and Cloud Performance
[Linux] Start Apache container with Docker
Run an application made with Java8 with Java6
Encrypt with Java and decrypt with C #
How to start Camunda with Docker
Build a web application development environment that uses Java, MySQL, and Redis with Docker CE for Windows
Wait for PostgreSQL to start with Docker and then start the WEB service
Creating a java web application development environment with docker for mac part1
Create a java web application development environment with docker for mac part2
How to create your own annotation in Java and get the value
Java: Try implementing your own comma-separated formatter
Start UI testing with Dagger2 and Mockito
Monitor Java applications with jolokia and hawtio
Building Rails 6 and PostgreSQL environment with Docker
Create your own validator with Bean Validation
Understand java interface in your own way
Let's try WebSocket with Java and javascript!
[Java] Reading and writing files with OpenCSV
Start web application development with Spring Boot
Communicate Gitlab and Gitlab Runner launched with Docker
Note: [Docker] How to start and stop
Install Docker and create Java runtime environment
Build Apache and Tomcat environment with Docker. By the way, Maven & Java cooperation
Organize your own differences in writing comfort between Java lambda expressions and Kotlin lambda expressions.