Java 17 (corretto)
Spring boot 3.0.2
JPA Hibernate 6.1.6
MySQL 8.0
Apache Kafka
- Redis는 할까? 말까? 할까? 말까?
- Gradle 멀티 모듈 변경
- To begin, Install Docker and Docker Compose on your server or local machine.
- Once installed successfully, run the below docker-compose command.
docker-compose --env-file container/.env.docker up -d
- After Gradle build, execute MainApplication(MyIdeJavaApplication) with the
local
profile as Spring Boot active profiles.
I wanted to explore different ways of executing actual code in Docker containers.
So I proceeded with three ways.
Implement using an HTTP request with container.
sequenceDiagram
box Client
participant SpringBoot
participant DockerClient
end
box Docker Container
participant Container
end
SpringBoot->>DockerClient: Transfer Code
DockerClient->>Container: HTTP Post Request to Flask route
Container->>DockerClient: Run a Code then respond result whatever success or failure as HTTP Response
DockerClient->>SpringBoot: Transfer result
Run a file, that is already implemented with a queue, on container.
sequenceDiagram
box Client
participant SpringBoot
participant DockerClient
end
box Docker Container
participant Container
end
SpringBoot->>DockerClient: Transfer Code
DockerClient->>Container: Container file로 전달 받은 Code를 arguments로 하여 파일 실행, Read Queue에 전달
Container->>DockerClient: Code를 실행하고 성공 or 실패한 출력 결과 Writer Queue가 출력
DockerClient->>SpringBoot: Transfer result
After create temp file, transfer the file to container.
Then, run a file on container.
sequenceDiagram
box Client
participant SpringBoot
participant DockerClient
end
box Docker Container
participant Container
end
SpringBoot->>DockerClient: Transfer Code
DockerClient->>Container: 임시 파일을 생성하고 Container로 생성한 파일 전달
Container->>DockerClient: 전달 받은 파일을 실행하고 성공 or 실패한 출력 결과 출력
DockerClient->>SpringBoot: Transfer result
- gradle > Tasks > verification > test
(For Result of Test)
- build > reports > tests > index.html
- gradle > Tasks > verification > jacocoTestReport
(For Coverage)
- build > jacoco > test > html > index.html
- Test viewfile for API Test on local
- test/resources/test_view.html
act -l
act -j build-test --container-architecture linux/amd64
- Kafka
- Codecov
- JWT 구현 참조