Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt

Use this file to discover all available pages before exploring further.

Docker Compose is the fastest way to run msvc-usuarios and msvc-cursos locally alongside their databases. msvc-auth and msvc-gateway are not included in the Compose file — for the full authenticated flow you must deploy to Kubernetes.

What Docker Compose Starts

ServiceContainerPort (host:container)Purpose
MySQL 8mysql83307:3306msvc-usuarios database
PostgreSQLpostgres-cursos5532:5432msvc-cursos database
msvc-usuariosmsvc-usuarios8001:8001Users REST API
msvc-cursosmsvc-cursos8002:8002Courses REST API

Prerequisites

  • Docker Desktop (macOS / Windows) or Docker Engine + Docker Compose plugin (Linux)
  • Docker Hub access to pull the public images:
    • miguelrodriguez15/msvc-usuarios:latest
    • miguelrodriguez15/msvc-cursos:latest

Quick Start

1

Databases only (recommended for development)

Start only the database containers first. This is faster and lets you run the Java services from your IDE against real databases:
docker compose up mysql8 postgres-cursos -d
2

Full stack (databases + services)

Start all four containers — both databases and both microservices — in detached mode:
docker compose up -d
3

Check containers are running

Confirm all expected containers are listed with a running status:
docker compose ps
4

Verify health endpoints

Spring Actuator exposes health probes on both services. A healthy response confirms the service started and connected to its database:
curl http://localhost:8001/actuator/health
curl http://localhost:8002/actuator/health
Expected response:
{"status":"UP","components":{"db":{"status":"UP"},"livenessState":{"status":"UP"},"readinessState":{"status":"UP"}}}
5

Make a test request (list users)

The Users API is available immediately on port 8001. Because msvc-auth is not running locally, this endpoint responds without requiring a Bearer token in the Docker Compose environment:
curl http://localhost:8001/

Stopping and Cleanup

# Stop all services but keep database volumes intact
docker compose down

# Stop all services and remove all volumes (destroys all database data)
docker compose down -v

Building Images Locally

The docker-compose.yml references pre-built images from Docker Hub by default. You can build locally from source and use those instead:
# Build msvc-usuarios from source
cd msvc-usuarios
docker build -t miguelrodriguez15/msvc-usuarios:latest .

# Build msvc-cursos from source
cd msvc-cursos
docker build -t miguelrodriguez15/msvc-cursos:latest .
The Compose file references env_file: msvc-usuarios/.env and env_file: msvc-cursos/.env. Create those files in the respective subdirectories to supply or override any environment variables for local development:
# msvc-usuarios/.env
PORT=8001
DB_HOT=mysql8:3306
DB_DATABASE=msvc_usuarios
DB_USERNAME=root
DB_PASSWORD=admin123
# msvc-cursos/.env
PORT=8002
DB_HOST=postgres-cursos:5432
DB_DATABASE=msvc_cursos
DB_USERNAME=postgres
DB_PASSWORD=postgres123

Persistent Volumes

Docker named volumes keep database data intact across container restarts:
VolumeMounted inData location
data-mysqlmysql8/var/lib/mysql
data-postgrespostgres-cursos/var/lib/postgresql/data
Both volumes are declared at the bottom of docker-compose.yml:
volumes:
  data-mysql:
    name: data-mysql
  data-postgres:
    name: data-postgres
To delete the volumes and start with a clean database state:
docker compose down -v

Shared Network

All four services are attached to a Docker bridge network named spring. Within that network, containers resolve each other by service name — for example, msvc-usuarios connects to MySQL using the hostname mysql8 and msvc-cursos connects to PostgreSQL using postgres-cursos.
networks:
  spring:
    name: spring
msvc-auth (the OAuth2 authorization server) and msvc-gateway are not part of docker-compose.yml. Running the full authenticated flow — obtaining a JWT and using it as a Bearer token — requires deploying all four services to Kubernetes. See Kubernetes Setup.

Build docs developers (and LLMs) love