-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor Docker Compose file naming to avoid V2 precedence conflict #69
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
Changes from 2 commits
58b61f1
4f448dc
9ef2559
a538671
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Local Development Database Configuration | ||
| # WARNING: These credentials are for LOCAL DEVELOPMENT ONLY. | ||
| # Production deployments MUST use secure credentials managed through | ||
| # environment variables or secrets management systems. | ||
|
|
||
| services: | ||
| mariadb: | ||
| image: mariadb:12.2 | ||
| environment: | ||
| MARIADB_DATABASE: springuser | ||
| MARIADB_USER: springuser | ||
| MARIADB_PASSWORD: springuser | ||
| MARIADB_ROOT_PASSWORD: rootpassword | ||
| ports: | ||
| - "3306:3306" | ||
| volumes: | ||
| - mariadb-data:/var/lib/mysql | ||
|
|
||
| volumes: | ||
| mariadb-data: | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,20 +1,91 @@ | ||||||
| # Local Development Database Configuration | ||||||
| # WARNING: These credentials are for LOCAL DEVELOPMENT ONLY. | ||||||
| # Production deployments MUST use secure credentials managed through | ||||||
| # environment variables or secrets management systems. | ||||||
|
|
||||||
| services: | ||||||
| mariadb: | ||||||
| image: mariadb:12.2 | ||||||
| myapp-db: | ||||||
| image: mariadb:11.6.2 | ||||||
| container_name: springuser-db | ||||||
| volumes: | ||||||
| - userdb:/var/lib/mysql | ||||||
| environment: | ||||||
| MARIADB_DATABASE: springuser | ||||||
| MARIADB_USER: springuser | ||||||
| MARIADB_PASSWORD: springuser | ||||||
| MARIADB_ROOT_PASSWORD: rootpassword | ||||||
| MYSQL_ROOT_PASSWORD: root | ||||||
| MYSQL_DATABASE: springuser | ||||||
| MYSQL_USER: springuser | ||||||
| MYSQL_PASSWORD: springuser | ||||||
| MYSQL_TCP_PORT: 3306 | ||||||
| ports: | ||||||
| - "3306:3306" | ||||||
| healthcheck: | ||||||
| test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ] | ||||||
| start_period: 1m | ||||||
| start_interval: 10s | ||||||
| interval: 1m | ||||||
| timeout: 5s | ||||||
| retries: 3 | ||||||
|
|
||||||
| mailserver: | ||||||
| image: docker.io/mailserver/docker-mailserver:latest | ||||||
| container_name: springuser-mail | ||||||
| hostname: mailserver | ||||||
| domainname: local | ||||||
| env_file: mailserver.env | ||||||
| ports: | ||||||
| - "25:25" | ||||||
| - "587:587" | ||||||
| volumes: | ||||||
| - mariadb-data:/var/lib/mysql | ||||||
| - maildata:/var/mail | ||||||
| - mailstate:/var/mail-state | ||||||
| - maillogs:/var/log/mail | ||||||
| - ./config/:/tmp/docker-mailserver/${SELINUX_LABEL} | ||||||
| environment: | ||||||
| PERMIT_DOCKER: connected-networks | ||||||
| ONE_DIR: 1 | ||||||
| DMS_DEBUG: 0 | ||||||
| SPOOF_PROTECTION: 0 | ||||||
| REPORT_RECIPIENT: 1 | ||||||
| ENABLE_SPAMASSASSIN: 0 | ||||||
| ENABLE_CLAMAV: 0 | ||||||
| ENABLE_FAIL2BAN: 1 | ||||||
| ENABLE_POSTGREY: 0 | ||||||
| SMTP_ONLY: 1 | ||||||
| cap_add: | ||||||
| - NET_ADMIN | ||||||
| - SYS_PTRACE | ||||||
| healthcheck: | ||||||
| test: ["CMD", "nc", "-z", "localhost", "25"] | ||||||
| interval: 30s | ||||||
| timeout: 10s | ||||||
| retries: 5 | ||||||
|
|
||||||
| myapp-main: | ||||||
| image: spring-user-framework-demo | ||||||
| container_name: springuser-app | ||||||
| build: | ||||||
| context: . | ||||||
| dockerfile: Dockerfile | ||||||
| depends_on: | ||||||
| myapp-db: | ||||||
| condition: service_healthy | ||||||
| mailserver: | ||||||
| condition: service_healthy | ||||||
| ports: | ||||||
| - "8080:8080" | ||||||
| environment: | ||||||
| SPRING_DATASOURCE_URL: jdbc:mariadb://myapp-db:3306/springuser?createDatabaseIfNotExist=true | ||||||
| SPRING_DATASOURCE_USERNAME: springuser | ||||||
| SPRING_DATASOURCE_PASSWORD: springuser | ||||||
| SPRING_PROFILES_ACTIVE: dev | ||||||
| SPRING_MAIL_HOST: mailserver | ||||||
| SPRING_MAIL_PORT: 25 | ||||||
| SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH: "false" | ||||||
| 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"] | ||||||
|
||||||
| test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | |
| test: ["CMD", "wget", "-qO-", "http://localhost:8080/actuator/health"] |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ logging: | |
| security: DEBUG # Set logging level for security | ||
|
|
||
| spring: | ||
| docker: | ||
| compose: | ||
| file: compose.dev.yaml | ||
|
Comment on lines
13
to
+16
|
||
| application: | ||
| name: Spring User Framework Demo App # Change this as per your convenience | ||
| datasource: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compose.dev.yamlusesmariadb:12.2while the other compose stacks (compose.yaml,docker-compose-keycloak.yml) usemariadb:11.6.2. Using different major/minor versions between localbootRunand 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).