Create a .env file in the sgivu-docker-compose directory with development values:
.env
# Database ConfigurationDEV_AUTH_DB_HOST=postgresDEV_AUTH_DB_PORT=5432DEV_AUTH_DB_NAME=sgivu_authDEV_AUTH_DB_USERNAME=postgresDEV_AUTH_DB_PASSWORD=dev_passwordDEV_USER_DB_HOST=postgresDEV_USER_DB_PORT=5432DEV_USER_DB_NAME=sgivu_userDEV_USER_DB_USERNAME=postgresDEV_USER_DB_PASSWORD=dev_passwordDEV_CLIENT_DB_HOST=postgresDEV_CLIENT_DB_PORT=5432DEV_CLIENT_DB_NAME=sgivu_clientDEV_CLIENT_DB_USERNAME=postgresDEV_CLIENT_DB_PASSWORD=dev_password# RedisREDIS_HOST=redisREDIS_PORT=6379REDIS_PASSWORD=dev_redis_password# Service DiscoveryEUREKA_URL=http://sgivu-discovery:8761/eureka# Service URLs (Docker internal)SGIVU_AUTH_URL=http://sgivu-auth:9000SGIVU_GATEWAY_URL=http://sgivu-gateway:8080DEV_ANGULAR_APP_URL=http://localhost:4200# SecuritySGIVU_GATEWAY_SECRET=dev-gateway-secret-change-in-prodSERVICE_INTERNAL_SECRET_KEY=dev-internal-key-change-in-prod# JWT ConfigurationJWT_KEYSTORE_LOCATION=classpath:keystore.jksJWT_KEYSTORE_PASSWORD=dev_keystore_passJWT_KEY_ALIAS=sgivu-jwtJWT_KEY_PASSWORD=dev_key_pass# FlywayFLYWAY_BASELINE_ON_MIGRATE=true
Use strong, unique values for production environments. These are development-only values.
3
Start Infrastructure Services
Start the foundational services first:
cd ~/projects/sgivu-docker-compose# Start PostgreSQL and Redisdocker compose up -d postgres redis# Wait for databases to be readydocker compose exec postgres pg_isready# Start Config Serverdocker compose up -d sgivu-config# Start Service Discoverydocker compose up -d sgivu-discovery
Verify services are healthy:
# Check Config Servercurl http://localhost:8888/actuator/health# Check Eurekacurl http://localhost:8761/actuator/health# Or visit http://localhost:8761 in browser
4
Start Application Services
Start the microservices in dependency order:
# Auth service (required by others)docker compose up -d sgivu-auth# Wait for auth to be healthydocker compose logs -f sgivu-auth# Watch for "Started SgivuAuthApplication"# Start other business servicesdocker compose up -d sgivu-user sgivu-client sgivu-vehicle sgivu-purchase-sale# Start Gateway (depends on all services)docker compose up -d sgivu-gateway
Services automatically fetch their configuration from sgivu-config on startup using the dev profile.
5
Verify the Stack
Check that all services are registered with Eureka:
# Stop the Docker container for the service you're developingdocker compose stop sgivu-auth# Run the service locally with your IDE or CLIcd ~/projects/sgivu-auth./mvnw spring-boot:run -Dspring.profiles.active=dev# The service will:# - Fetch config from Config Server at http://localhost:8888# - Connect to databases in Docker# - Register with Eureka in Docker# - Support hot-reload via Spring DevTools
Ensure your local service can reach Docker services. Use host.docker.internal or localhost for database connections when running locally.
Verify the Config Server is serving the right configuration:
# Test endpointcurl http://localhost:8888/sgivu-auth/dev# Check Config Server logsdocker compose logs sgivu-config# Verify Git repo is up to date (if using Git backend)docker compose exec sgivu-config cat /config-repo/sgivu-auth-dev.yml