Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt

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

Docker Compose is the fastest way to get CulturarteWeb running end-to-end. A single docker-compose up --build command builds the Tomcat application image, starts a MySQL 8 database, seeds it with sample data, and wires everything together — no local Tomcat or MySQL installation required.

Prerequisites

Docker Desktop or Docker Engine

Docker Desktop (macOS/Windows) or Docker Engine + the Compose plugin (Linux). Docker Compose v2 (docker compose) or the standalone docker-compose binary both work.

SOAP & REST services running

The SOAP ControllerWS service (default port 9125) and the REST proponentes service (default port 9126) must be reachable from the Docker host before starting the application container.

Services overview

The docker-compose.yml file declares two services that start together:
ServiceImageContainer nameHost port → Container port
culturarteBuilt from Dockerfile (Tomcat 10.1-jdk21)appCulturarteWeb8080 → 8080
dbculturarteWebmysql:8.0.17BaseDatosC3307 → 3306
The culturarte service declares depends_on: dbculturarteWeb, so Docker Compose always starts the database container first before bringing up the application.
docker-compose.yml
services:
  # definicion de servicios
  culturarte: 
    build:
      #indica donde se encuentra el dokerfile . es el directorio actual osea doker compose esta en el mismo directorio que dockerfile 
      context: .
      # esto es para que ejecute el dokerile, hacer  build 
      dockerfile: Dockerfile
      #nnombre contenedor
    container_name: appCulturarteWeb
    #le decimos que depende del servicio de la db (primero se inicia la bd luego este)
    depends_on:
      - dbculturarteWeb
    ports:
      #mapeamos puerto externo local  y el interno docker 
      - "8080:8080"
    volumes:
      #volumen para acceder a la carpeta IMG
      - /home/fran/Escritorio/Lab2PA/IMG:/IMG
      #volumen para pc de facultad(verificar igualmente)
      #- /home/tecnologo/CulturarteEquipo7/CulturarteWeb/IMG:/IMG
      #Servicio de BD
  dbculturarteWeb:
    # el mysql que va a contener el contenedor
    image: mysql:8.0.17
    #nombre contenedor
    container_name: BaseDatosC
    environment:
      #nombre de la db que se creaara al crear el contenedor
      MYSQL_DATABASE: Culturarte
      #contrasena para el usuario root
      MYSQL_ROOT_PASSWORD: tecnologo
      #la pass para el usuario
      MYSQL_PASSWORD: tecnologo 
      #usuario no root es el que usuamos para conectarnos a la bd
      MYSQL_USER: tecnologo
    volumes:
      #cuando se cree el doker se inicia con la bd copia (es la bd con los datos de prueba)
      - ./copia.sql:/docker-entrypoint-initdb.d/copia.sql
      #volumen donde se guardara la bd creada dentro del docker
      - db_data:/var/lib/mysql
    ports:
      # puerto local:interno docker
      - "3307:3306"

volumes:
  db_data:

Volume mounts

Application image volume

The culturarte service mounts a host directory into /IMG inside the container. This is the path from which the application serves event images:
volumes:
  - /home/fran/Escritorio/Lab2PA/IMG:/IMG
You must update the left-hand side of this mapping to the absolute path on your local machine where event images are stored. For example:
volumes:
  - /home/your-user/projects/CulturarteWeb/IMG:/IMG
The right-hand side (/IMG) must stay as-is — it corresponds to the RUTA_IMG value read from config.properties.

Database seed volume

The dbculturarteWeb service mounts copia.sql from the project root into MySQL’s docker-entrypoint-initdb.d/ directory. MySQL automatically executes every .sql file found there on the very first container start, populating the Culturarte database with the bundled sample data. A named volume db_data persists the database across container restarts.

Dockerfile

The application image is built from this Dockerfile at the project root:
Dockerfile
# Usamos Tomcat con JDK 21 la imagen 
FROM tomcat:10.1-jdk21

# el war_file guarda el war generado del servidor web con dependecias
ARG WAR_FILE=target/Lab2PA-1.0-SNAPSHOT.war

# Copiamos el WAR dentro de Tomcat se copia en esa ruta para ser accedido directamente desde http://localhost:8080
COPY ${WAR_FILE} /usr/local/tomcat/webapps/ROOT.war

# puerto que exponemos de docker (interno)
EXPOSE 8080

# Arrancamos Tomcat
CMD ["catalina.sh", "run"]
The WAR is deployed as ROOT.war so the application is accessible directly at http://localhost:8080 with no context-path prefix.

Environment variables passed to MySQL

The dbculturarteWeb service receives these environment variables at container creation time:
VariableValuePurpose
MYSQL_DATABASECulturarteName of the database created automatically
MYSQL_USERtecnologoNon-root application user
MYSQL_PASSWORDtecnologoPassword for tecnologo user
MYSQL_ROOT_PASSWORDtecnologoPassword for the MySQL root account
The default MySQL credentials (tecnologo / tecnologo) are intended for development only. Before deploying to any internet-facing or shared environment, change all four values in docker-compose.yml and update the corresponding database connection settings in the application.
The database is seeded from copia.sql automatically the first time the dbculturarteWeb container starts. If you need to re-seed a fresh database, remove the named volume with docker-compose down -v before running docker-compose up --build again.

Build and run

1

Update the IMG volume path

Open docker-compose.yml and replace the left-hand side of the culturarte volume mount with the actual path to your event images directory:
volumes:
  - /path/to/your/IMG:/IMG
2

Build the image and start all services

From the project root (the directory containing docker-compose.yml and Dockerfile), run:
docker-compose up --build
Docker Compose will build the culturarte image, pull mysql:8.0.17, start the database, seed it with copia.sql, and then start Tomcat. The first build may take a few minutes to download base images and compile the WAR.
3

Verify the application

Once you see Tomcat startup logs in the terminal, open your browser and navigate to:
http://localhost:8080
The CulturarteWeb home page should load.
4

Stop all services

Press Ctrl+C in the terminal running Compose, then run:
docker-compose down
Add -v if you also want to remove the db_data named volume and start with a clean database next time.

Build docs developers (and LLMs) love