The project ships with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebax85/backend-prueba-fullstack/llms.txt
Use this file to discover all available pages before exploring further.
Dockerfile and a docker-compose.yml that together define the full runtime environment. A two-stage Docker build keeps the final image lean, and Docker Compose orchestrates the database and backend containers with a defined startup order.
Dockerfile: two-stage build
TheDockerfile uses two stages to separate the build environment from the runtime image:
Dockerfile
| Stage | Base image | Purpose |
|---|---|---|
build | maven:3.9.6-eclipse-temurin-17 | Compiles the source code and packages the JAR |
| Runtime | eclipse-temurin:17-jdk | Runs the compiled JAR — no Maven or source files included |
Docker Compose services
docker-compose.yml
| Service | Container name | Port mapping | Description |
|---|---|---|---|
db | postgres_db | 5432:5432 | PostgreSQL 15 database |
backend | backend_app | 8080:8080 | Spring Boot REST API |
Startup order and health check
Thebackend service declares depends_on: db, so Docker Compose will not start the backend until the db service is running. The db service also defines a health check:
docker-compose.yml
pg_isready -U postgres every 5 seconds. After up to 10 retries (50 seconds total), if PostgreSQL is not accepting connections, the container is marked unhealthy. The backend connection pool is configured with initialization-fail-timeout=0, meaning it will keep retrying to acquire a connection rather than failing immediately.
depends_on in Compose v3 only waits for the container to start, not for it to be healthy, unless you combine it with condition: service_healthy. The Hikari pool retry behavior compensates for this in the current configuration.Common commands
Start only the database
postgres_db container in detached mode. Useful when you want to run the backend locally outside of Docker.Build and start the backend
backend_app image from the Dockerfile and starts the container. Run this after any source code changes.Stop all services
docker-compose.yml. Database data persists if a named volume is configured; otherwise it is lost when the container is removed.Troubleshooting
Backend fails to connect to the database
If the backend logs show connection errors on startup, the database may not have finished initializing before the backend attempted its first connection.Check database health
STATUS column for the db service. It should read healthy. If it shows starting or unhealthy, wait a few seconds and check again.Next steps
Configuration guide
Understand the environment variables and connection pool settings.
Database guide
Explore the schema, connect to PostgreSQL, and restore backups.