Task 1
Create a Spring boot project named task-manager.
- Add an echo endpoint with a GET method.
- Add an echo endpoint with a POST method.
- Add an echo endpoint with a DELETE method.
- Add an echo endpoint with a PUT method.
Task 2
Build a project with Maven
./mvnw clean
./mvnw install
./mvnw package
Add a Dockerfile to create an image with a Spring boot project.
FROM eclipse-temurin:latest
COPY target/*.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Create an image
docker build -t demo .
Add a compose.yaml file to describe a container to drop the project image into.
services:
app:
image: <image name>
ports:
- "<host port>:8080"
Start the application in Docker:
docker compose up
Open the project and send echo messages.
Task 3
Create a configuration for executing and tracking errors in the project from task-manager. To do this, you need to modify compose.yml
image: - section should be replaced with build image:
build:
context: .
dockerfile: Dockerfile
Select edit of the startup configuration
Select launch in docker-compose
As the configuration file, select the compose.yml file in project
Service the project from the compose file and select next.
Once the image is built select next. On the last step select create.
Select Run to start the container in Docker.