Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Git & version control
.git
.gitignore
.gitattributes

# Build artifacts (very important!)
target/
build/
*.jar # unless you COPY it explicitly – but usually not needed
*.war

# IDE & editor files
.idea/
.vscode/
*.iml
*.iws
*.swp
*.swo
.DS_Store

# Logs, temp, local configs
*.log
logs/
tmp/
temp/
*.tmp
*.bak

# Maven/Gradle wrapper & cache
.mvn/
gradle/
gradlew
gradlew.bat
.m2/
.gradle/

# Docker & compose files (optional – prevents sending them unnecessarily)
Dockerfile*
docker-compose*
*.dockerignore

# Environment & secrets (critical!)
.env
.env.*
*.secret
application-secrets.yml

# Tests & coverage
coverage/
jacoco.exec
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ build/

### VS Code ###
.vscode/

.env
.env.local
.env.*
12 changes: 8 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ services:
dockerfile: users_microservice/Dockerfile
image: leonard1thecoder/aa-users-microservice:latest
environment:
SPRING_PROFILES_ACTIVE: docker
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-dev}
SPRING_REDIS_HOST: ${REDIS_HOST:-redis}
SPRING_REDIS_PORT: ${REDIS_PORT:-6379}
SUPABASE_URL: ${SUPABASE_URL} # ← pulled from .env
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
PORT: ${CONTAINER_PORT:-9098}
ports:
- "8080:9098" # Adjust if needed
- "${APP_EXTERNAL_PORT:-8080}:${CONTAINER_PORT:-9098}" # Adjust if needed
depends_on:
redis:
condition: service_healthy # Waits until Redis reports healthy
Expand Down
18 changes: 18 additions & 0 deletions users_microservice/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring.config.active.on-profile=dev

spring.sql.unit.mode= always


# MySQL Database Configuration
spring.datasource.url=${SUPABASE_URL}

spring.flyway.clean-disabled=false

server.port=${PORT}
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=${MAIL_USERNAME}
spring.mail.password=${MAIL_PASSWORD}
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.docker.compose.enabled=true

This file was deleted.

28 changes: 28 additions & 0 deletions users_microservice/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
spring.config.active.on-profile=prod
# MySQL Database Configuration
spring.datasource.url=${SUPABASE_URL}

spring.flyway.clean-disabled=true
spring.flyway.enabled=true

logging.level.root=WARN
logging.level.org.springframework=INFO
logging.level.org.hibernate=WARN


server.port=${PORT}
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=${MAIL_USERNAME}
spring.mail.password=${MAIL_PASSWORD}
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.docker.compose.enabled=false

spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.connection-timeout=20000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.leak-detection-threshold=2000
spring.datasource.hikari.pool-name=UsersHikariPool
17 changes: 10 additions & 7 deletions users_microservice/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
spring.application.name=AA
# MySQL Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/aa
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.docker.compose.file=src/main/resources/compose.yaml
logging.level.org.springframework.boot.docker.compose=DEBUG
spring.docker.compose.lifecycle-management=start_only
spring.threads.virtual.enabled= true

spring.datasource.driver-class-name=org.postgresql.Driver



# JPA Configuration
spring.jpa.hibernate.ddl-auto=update
hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.show-sql=true
spring.jpa.format-sql=true
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
spring.jpa.open-in-view=false
Loading