Skip to content

Refactor Docker Compose file naming to avoid V2 precedence conflict#69

Merged
devondragon merged 4 commits intomainfrom
feature/68-refactor-compose-naming
Mar 22, 2026
Merged

Refactor Docker Compose file naming to avoid V2 precedence conflict#69
devondragon merged 4 commits intomainfrom
feature/68-refactor-compose-naming

Conversation

@devondragon
Copy link
Owner

Summary

  • Renames compose.yamlcompose.dev.yaml (dev dependencies for bootRun) and docker-compose.ymlcompose.yaml (full deployable stack) to resolve Docker Compose V2 precedence conflict
  • Adds spring.docker.compose.file=compose.dev.yaml to application-local.yml-example so Spring Boot finds the dev compose file
  • Updates README.md with compose file descriptions and Docker Compose V2 CLI syntax

Closes #68

Test plan

  • Verify ./gradlew bootRun with local profile picks up compose.dev.yaml and starts the dev database
  • Verify docker compose up --build uses compose.yaml and starts the full stack (app + db + mail)
  • Verify docker compose -f docker-compose-keycloak.yml up --build still works for the Keycloak stack

…#68)

Docker Compose V2 prioritizes compose.yaml over docker-compose.yml,
which conflicted with using compose.yaml for Spring Boot's Docker
Compose integration (dev-only) and docker-compose.yml for the full stack.

- Rename compose.yaml -> compose.dev.yaml (dev dependencies for bootRun)
- Rename docker-compose.yml -> compose.yaml (full deployable stack)
- Add spring.docker.compose.file=compose.dev.yaml to application-local.yml-example
- Update README.md with compose file descriptions and docker compose v2 syntax
Copilot AI review requested due to automatic review settings March 22, 2026 18:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors Docker Compose file naming to avoid Docker Compose V2 precedence issues by separating the dev-only Compose stack used by Spring Boot from the full deployable stack, and updates documentation/configuration accordingly.

Changes:

  • Renames/migrates dev-only Compose setup into compose.dev.yaml and makes compose.yaml the full deployable stack.
  • Updates application-local.yml-example to point Spring Boot Docker Compose integration at compose.dev.yaml.
  • Updates README and CHANGELOG with the new filenames and Docker Compose V2 CLI syntax.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/resources/application-local.yml-example Adds spring.docker.compose.file=compose.dev.yaml to direct Spring Boot to the dev Compose file.
docker-compose.yml Removes the legacy full-stack Compose file (migrated to compose.yaml).
compose.yaml Becomes the default full-stack Compose file (app + DB + mailserver).
compose.dev.yaml Adds a dev-only Compose file (database only) for bootRun/local development.
README.md Updates Compose usage docs (file descriptions + docker compose CLI syntax).
CHANGELOG.md Documents the Compose naming refactor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to +17
spring:
docker:
compose:
file: compose.dev.yaml
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application-local.yml-example is currently invalid YAML: logging.level.org.springframework.web is set to the scalar DEBUG but then filter: is indented beneath it. YAML scalars can’t have child keys, so Spring won’t be able to parse this file when someone copies it to application-local.yml. Restructure the logging section (e.g., make web: a map containing filter, or flatten the key) so the example config is parseable.

Copilot uses AI. Check for mistakes.

services:
mariadb:
image: mariadb:12.2
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compose.dev.yaml uses mariadb:12.2 while the other compose stacks (compose.yaml, docker-compose-keycloak.yml) use mariadb:11.6.2. Using different major/minor versions between local bootRun and the full stack can cause schema/behavior drift and “works locally but not in Docker” issues. Consider aligning the MariaDB image version across compose files (or document why they intentionally differ).

Suggested change
image: mariadb:12.2
image: mariadb:11.6.2

Copilot uses AI. Check for mistakes.
compose.yaml Outdated
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE: "false"
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_REQUIRED: "false"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The myapp-main healthcheck runs curl, but the Dockerfile installs and uses wget for health checks (and doesn’t install curl explicitly). This can make the Compose healthcheck fail and mark the app as unhealthy even when it’s running. Update the Compose healthcheck to use wget (or install curl in the image) so the healthcheck command matches what’s available in the container.

Suggested change
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
test: ["CMD", "wget", "-qO-", "http://localhost:8080/actuator/health"]

Copilot uses AI. Check for mistakes.
- Fix invalid YAML in application-local.yml-example: flatten CommonsRequestLoggingFilter
  key so web: remains a valid scalar and filter config is a sibling key
- Align MariaDB version to 11.6.2 in compose.dev.yaml to match compose.yaml
- Fix compose.yaml app healthcheck to use wget (installed in Dockerfile) instead of curl
@devondragon devondragon merged commit a3181de into main Mar 22, 2026
6 checks passed
@devondragon devondragon deleted the feature/68-refactor-compose-naming branch March 22, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Docker Compose file naming to avoid V2 precedence conflict

2 participants