-
Notifications
You must be signed in to change notification settings - Fork 5
feat(infra): add docker-compose support and configure testcontainers #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c356cf5
feat(worker): add docker-compose configuration for postgres and redis
nakberli841-bot 2897313
feat(backend): add postgres and redis configs to api and worker
nakberli841-bot a02ca4b
docs(backend): add docker setup instructions to README
nakberli841-bot fd4836d
test(infra): configure Testcontainers with ServiceConnection for api …
nakberli841-bot 430e129
chore(backend): use testcontainers-bom for version management
nakberli841-bot 96e7b69
chore(backend): Enable health checks for database and redis in both a…
nakberli841-bot 4b4268d
chore(docker): improve postgres setup with volumes and healthchecks
nakberli841-bot 164131c
chore(backend): configure environment variables and dynamic database …
nakberli841-bot e436601
docs(backend): update readme with clear instructions for docker and g…
nakberli841-bot aec5807
fix(deps): add spring-boot-testcontainers dependency for integration …
nakberli841-bot 462dbf5
Merge branch 'main' into feature/4-docker-compose-setup
nakberli841-bot 0f41b8f
Update application.yml
nakberli841-bot 4250c55
Delete backend/docker
nakberli841-bot 4b0c3b1
refactor: clean up files, README, and health configuration
nakberli841-bot e06d034
docs: update README (missed in previous commit)
nakberli841-bot 0727719
Delete backend/initializationError,backend/Task,backend/There
nakberli841-bot 2954736
Create .env.example
nakberli841-bot 18f4833
Delete backend/There,backed/Task
nakberli841-bot 0c3ebfd
Delete backend/Task
nakberli841-bot 6289031
Delete .env.example
nakberli841-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| POSTGRES_USER=cleat | ||
| POSTGRES_PASSWORD=password | ||
| POSTGRES_DB=cleat_db | ||
|
|
||
| DB_USERNAME=cleat | ||
| DB_PASSWORD=password | ||
| DB_NAME=cleat_db | ||
| DB_HOST=localhost | ||
| REDIS_HOST=localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ build/ | |
| # Local env | ||
| *.local | ||
| application-local.yml | ||
| .env | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/apps/api/src/test/java/dev/cleat/api/AbstractIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package dev.cleat.api; | ||
|
|
||
| import org.springframework.boot.test.context.SpringBootTest; | ||
| import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
| import org.testcontainers.containers.GenericContainer; | ||
| import org.testcontainers.containers.PostgreSQLContainer; | ||
| import org.testcontainers.junit.jupiter.Container; | ||
| import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
|
||
| @Testcontainers | ||
| @SpringBootTest | ||
| public abstract class AbstractIntegrationTest { | ||
|
|
||
| @Container | ||
| @ServiceConnection | ||
| static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine"); | ||
|
|
||
| @Container | ||
| @ServiceConnection | ||
| static GenericContainer<?> redis = new GenericContainer<>("redis:7-alpine").withExposedPorts(6379); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/apps/worker/src/test/java/dev/cleat/worker/AbstractIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package dev.cleat.worker; | ||
|
|
||
| import org.springframework.boot.test.context.SpringBootTest; | ||
| import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
| import org.testcontainers.containers.GenericContainer; | ||
| import org.testcontainers.containers.PostgreSQLContainer; | ||
| import org.testcontainers.junit.jupiter.Container; | ||
| import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
|
||
| @Testcontainers | ||
| @SpringBootTest | ||
| public abstract class AbstractIntegrationTest { | ||
|
|
||
| @Container | ||
| @ServiceConnection | ||
| static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine"); | ||
|
|
||
| @Container | ||
| @ServiceConnection | ||
| static GenericContainer<?> redis = new GenericContainer<>("redis:7-alpine").withExposedPorts(6379); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| services: | ||
| postgres: | ||
| image: postgres:16-alpine | ||
| environment: | ||
| POSTGRES_USER: ${POSTGRES_USER:-cleat} | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} | ||
| POSTGRES_DB: ${POSTGRES_DB:-cleat_db} | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - postgres_data:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cleat}"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| redis: | ||
| image: redis:7 | ||
| ports: | ||
| - "6379:6379" | ||
|
|
||
| volumes: | ||
| postgres_data: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.