The frontend service renders the CV as a web page in the browser. It is a React 18 single-page application that fetches data from the backend API and displays a profile photo, name, city, and education history. In production the compiled output is served by Nginx, which is configured to listen on port 3000 instead of the default port 80.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jperez77775/ProyectoDocker/llms.txt
Use this file to discover all available pages before exploring further.
Technology stack
| Component | Version |
|---|---|
| React | 18.2.x |
| axios | 1.6.x |
| react-scripts | 5.0.1 |
| Nginx | 1.27 (Alpine) |
docker-compose.yml.
What it renders
Once the backend responds successfully, the app renders a CV page with:- A circular profile photo loaded from the
fotoURL in the API response - The person’s full name (
nombre+apellido) as a heading - Their city (
ciudad) below the name - A bulleted education list (
formacion) with degree title, institution, and year for each entry
Auto-retry behavior
ThecargarDatos() function is called inside a useEffect hook on mount. It sends a GET request to http://localhost:4000/cv. If the request fails — for example because the backend container is still starting — it sets isRetrying to true and schedules another attempt in 3 seconds. This loop continues until the backend responds successfully.
src/App.js
clearTimeout in the cleanup function prevents a stale timer from firing after the component unmounts.
Loading states
The app has three distinct visual states:| State | Condition | What the user sees |
|---|---|---|
| Initial loading | !cvData and !isRetrying | Plain text: “Iniciando aplicación…” |
| Retry / waiting | isRetrying and !cvData | Spinning circle with a message explaining that Docker services are synchronizing |
| Success | cvData is set | Full CV page with photo, name, city, and education list |
Multi-stage Dockerfile
The image uses a two-stage build. Stage 1 compiles the React app using Node 20. Stage 2 copies only the compiled output into a fresh Nginx image, keeping the final image small by discarding the Node runtime andnode_modules.
Dockerfile
The
sed command in stage 2 rewrites Nginx’s default configuration file, replacing the listen 80; directive with listen 3000;. This is necessary because docker-compose.yml maps host port 3000 to container port 3000, and the ports must match.