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.

The SearchJobs backend is configured entirely through environment variables. Docker Compose reads these from a .env file in the repository root and injects them into the springboot-app container at startup. This page lists every variable, explains its purpose, and provides a complete sample file you can copy and customise.

Backend variables

These variables are consumed by the Spring Boot application. All of them must be present in your .env file — the backend will fail to start if any required variable is missing.
VariableDescriptionExample value
SPRING_DATASOURCE_URLJDBC connection URL for MySQL. Use the Docker service hostname mysql when running inside Compose.jdbc:mysql://mysql:3306/mydb
SPRING_DATASOURCE_USERNAMEMySQL user that Spring Boot connects as.root
SPRING_DATASOURCE_PASSWORDPassword for the MySQL user. The Compose file hard-codes an empty string for local dev.(empty)
SPRING_JPA_HIBERNATE_DDL_AUTOControls how Hibernate manages the schema on startup. Use update for development, validate or none for production.update
MY_SECRET_KEYSecret used to sign JWT tokens. Must be kept private. A minimum of 32 characters is recommended; use 64 for stronger security.(random hex string)
JWT_EXPIRATIONJWT token lifetime in milliseconds. 86400000 equals 24 hours.86400000
MONGODB_URIMongoDB connection string for the chat/messaging feature. MongoDB is not included in docker-compose.yml — use MongoDB Atlas or a standalone container.mongodb://localhost:27017/chatdb
UPLOAD_DIR_IMGAbsolute path inside the container where image uploads are stored. Matches the volume mount /app/uploads./app/uploads/images/
UPLOAD_DIR_PDFAbsolute path inside the container for PDF uploads./app/uploads/pdfs/
UPLOAD_DIR_VIDEOAbsolute path inside the container for video uploads./app/uploads/videos/
URL_FRONTENDFrontend origin used for CORS configuration. Must match the URL your browser uses to reach the React app.http://localhost:5173
MY_SECRET_KEY is a cryptographic secret. Do not commit it to version control, share it in logs, or use a short or guessable value. Generate it with a command like openssl rand -hex 32.

MySQL service variables (docker-compose.yml)

The mysql service is configured directly inside docker-compose.yml and does not read from .env. These values are fixed for local development:
VariableValueNotes
MYSQL_DATABASEmydbThe database created automatically on first start. Your SPRING_DATASOURCE_URL must reference this name.
MYSQL_ALLOW_EMPTY_PASSWORDyesAllows the root user to connect with no password. Change this for any non-local environment.
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" is convenient for local development but must never be used in production. See Production deployment for how to harden the database configuration.

Sample .env file

Copy the block below to a file named .env in the repository root and replace the placeholder values before running docker-compose up.
# ── Database ──────────────────────────────────────────────────────────────────
SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/mydb
SPRING_DATASOURCE_USERNAME=root
SPRING_DATASOURCE_PASSWORD=

# ── JPA / Hibernate ───────────────────────────────────────────────────────────
# Use "update" for development. Switch to "validate" or "none" in production.
SPRING_JPA_HIBERNATE_DDL_AUTO=update

# ── JWT ───────────────────────────────────────────────────────────────────────
# Generate with: openssl rand -hex 32
MY_SECRET_KEY=replace-with-a-random-64-char-hex-string
JWT_EXPIRATION=86400000

# ── MongoDB (chat feature) ────────────────────────────────────────────────────
MONGODB_URI=mongodb://localhost:27017/chatdb

# ── File upload directories ───────────────────────────────────────────────────
UPLOAD_DIR_IMG=/app/uploads/images/
UPLOAD_DIR_PDF=/app/uploads/pdfs/
UPLOAD_DIR_VIDEO=/app/uploads/videos/

# ── CORS ──────────────────────────────────────────────────────────────────────
URL_FRONTEND=http://localhost:5173
The .env file is excluded from version control by .gitignore (**/.env*). Do not rename it or move it out of the repository root — Docker Compose expects to find it there via the env_file: - .env directive on the backend service.

Build docs developers (and LLMs) love