[JAVA] Run JSP Hello World with Tomcat on Docker

When the response of JSP, which I rarely touch, suddenly came in, I was wondering what to do first, so I will leave it as a memo

What to use

procedure

  1. Prepare docker-compose.yml --Specify the official Docker image for Tomcat --Mount the webapps directory and start the tomcat container
  2. Place the application directory under the webapps directory and place the JSP --This time, set it to helloworld
  3. Start

Directory structure

├── docker-compose.yml
└── webapps
    └── `Application name`
        ├── WEB-INF
        │   └── lib
        │       └── `Required libraries such as JSTL`
        └── index.jsp

1. Prepare docker-compose.yml

docker-compose.yml

version: '3'

services:
  tomcat:
    image: tomcat:9.0.13-jre11-slim
    volumes:
      - ./webapps:/usr/local/tomcat/webapps
    ports:
      - 8080:8080

2. Place the application directory under the webapps directory and place the JSP

webapps/helloworld/index.jsp

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Hello, world!</title>
</head>
<body>
  <h1><%= "Hello, world!" %></h1>
</body>
</html>

3. Start

Other troubles

Recommended Posts

Run JSP Hello World with Tomcat on Docker
Hello World with Docker and C
Hello World with GlassFish 5.1 + Servlet + JSP
JSP on tomcat
Java development with Codenvy: Hello World! Run
Run Ubuntu + ROS with Docker on Mac
Run Pico with docker
Run Payara with Docker
Hello World on WebAssembly
Hello World with Micronaut
Run phpunit on Docker
Easy to display hello world with Rails + Docker
Hello World with Spring Boot
Run TAO Core with Docker
Run openvpn on Docker (windows)
Hello World with Spring Boot!
Hello World with VS Code!
java hello world, compile, run
Run Rails whenever with docker
Hello World with Spring Boot
Hello World with SpringBoot / Gradle
Hello, World! With Asakusa Framework!
Try Hello World using plain Java on a Docker container
Run lambda with custom docker image
Run SSE (Server-Sent-Event) samples on docker
Steps to run docker on Mac
Run SQL Server with Docker ToolBox
Run puppeteer-core on Heroku (Docker edition)
Run React on a Docker container
Until "Hello World" with Spring Boot
Run the AWS CLI on Docker
How to run JavaFX on Docker
Hello World on AWS Lambda + Java
Hello world with Kotlin and JavaFX
Run GUI application on Docker container
WordPress with Docker Compose on CentOS 8
(Intellij) Hello World with Spring Boot
Run PureScript on a Docker container
Run tomcat shell script on java8
Create PDF with itext7 ~ Hello World ~
Make JupyterLab run anywhere with docker
"Hello world" for ImageJ with Eclipse
Hello World with GWT 2.8.2 and Maven
Run (provisionally) a Docker image with ShellCommandActivity on AWS Data Pipeline
Run NordVPN on Docker (Windows) Ubuntu container
Run Embulk on Docker to convert files
Hello World with Eclipse + Spring Boot + Maven
Hello world with Java template engine Thymeleaf
"Hello, World!" With Kotlin + CLI in 5 minutes
Hello World on Mac VS Code Java
Hello world with Kotlin and Tornado FX
Build an environment with Docker on AWS
How Spring Security works with Hello World
Until you run apache on ubuntu on docker
Launched Redmine with Docker on Raspberry Pi 3
(IntelliJ + gradle) Hello World with Spring Boot
How to run Blazor (C #) with Docker
Hello World with Java Servlet and JSP (Easy web server startup with Maven + Jetty)
Hello World, a cross-platform GUI app with Groovy running on the Java platform
Try running MPLS-VPN with FR Routing on Docker
Run GUI application on Docker container (Japanese input)