Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Esteban-Mendez-j/Proyecto-Docker/llms.txt

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

SearchJobs ships with a Docker Compose configuration that manages the MySQL database and the Spring Boot backend as containerised services. The React frontend (client/) runs outside Docker during development and is built as a static bundle for production. This guide walks you through every step needed to get the full stack running locally or on a server.

Prerequisites

Before you begin, make sure the following tools are installed:
ToolMinimum version
Docker Engine20.10+
Docker Composev2 (docker compose CLI plugin)
Gitany recent version
Node.js18+ (for running the React frontend)
Docker Desktop for Mac and Windows ships with Compose v2 by default. On Linux, install the docker-compose-plugin package or follow the official Compose installation guide.

Services defined in docker-compose.yml

The docker-compose.yml at the repository root defines two active services. A third service (astro) is commented out — it was an earlier Astro frontend and is not used.
ServiceImage / BuildPortNotes
mysqlmysql:8.03306Persistent volume mysql_data, network app-network
backendBuilt from ./Proyecto_backup/Dockerfile8080Container name springboot-app, reads .env, mounts ./Proyecto_backup/uploads:/app/uploads
The React frontend (client/) is not a Docker service. It must be started separately — see the Frontend section below.

Dockerfile (multi-stage build)

The backend image uses a two-stage Dockerfile located at Proyecto_backup/Dockerfile:
# Stage 1 — build the JAR with Maven
FROM maven:3.9.4-eclipse-temurin-21 AS builder
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests

# Stage 2 — lightweight runtime image
FROM eclipse-temurin:21-jdk-alpine
WORKDIR /app
COPY --from=builder /app/target/Proyecto-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
Stage 1 uses the full Maven + JDK 21 image to compile the project and produce the fat JAR. Stage 2 copies only the JAR into a minimal Alpine-based JDK image, keeping the final image small.

Step-by-step deployment

1

Clone the repository

git clone https://github.com/Esteban-Mendez-j/Proyecto-Docker.git
cd Proyecto-Docker
2

Create the .env file

The backend service reads its configuration from a .env file in the repository root. Copy the sample below and fill in your values before continuing.
cp .env.example .env   # if an example file exists, otherwise create it manually
See Environment variables for the full reference and a ready-to-use sample file.
Never commit .env to version control. It is already excluded by .gitignore (**/.env*).
3

Build and start the services

Run the following command from the repository root:
docker-compose up --build -d
Docker Compose builds the Spring Boot image (this takes a few minutes on the first run because Maven downloads dependencies), pulls mysql:8.0, and starts both containers in detached mode.
4

Verify the services are running

docker-compose ps
Both mysql and springboot-app should show a running (or Up) status.
5

Check the logs

docker-compose logs -f
Watch for the Spring Boot startup banner and a line like Started ... in X seconds. If the backend fails to connect to MySQL, confirm that your SPRING_DATASOURCE_URL points to the mysql service hostname (e.g. jdbc:mysql://mysql:3306/mydb).

Useful commands

docker-compose down

Frontend

The React client lives in the client/ directory and is powered by Vite with the @vitejs/plugin-react-swc plugin. Development mode — starts a hot-reload dev server on http://localhost:5173:
cd client
npm install
npm run dev
Production build — outputs static files to client/dist/:
cd client
npm install
npm run build
Serve the client/dist/ directory with nginx, Vercel, or any static file host. See Production deployment for guidance on serving the built frontend alongside the Dockerised backend.
The Vite config sets base: '/' and enables source maps in production builds. No additional Vite configuration is required for a standard deployment.

Build docs developers (and LLMs) love