Kubrik OSSUPPORTSOPORTE All productsTodos los productos
Technical manualManual técnico › Installation › Installing › Installing with Docker ComposeInstalación › Instalación › Instalar con Docker Compose

Installing with Docker Compose

Instalar con Docker Compose

Each edition has its own Compose file that starts the database, the cache, the application and the administration app. The files are a starting point: before the first start you complete the settings of the application and replace the sample passwords.

Cada edición tiene su archivo Compose, que levanta la base de datos, la caché, la aplicación y la aplicación de administración. Los archivos son un punto de partida: antes del primer arranque completás los ajustes de la aplicación y reemplazás las contraseñas de ejemplo.

👤 Who: System administrator📍 Where: Root of the source tree · docker-compose.<edition>.yml
👤 Quién: Administrador de sistemas📍 Dónde: Raíz del código fuente · docker-compose.<edición>.yml

What each file starts

Qué levanta cada archivo

ServiceAddress on the serverNotes
frontendhttp://localhost:80The administration app. It waits for backend.
backendhttp://localhost:8222The application. It waits until the database and the cache answer.
postgreslocalhost:5444Database ks_erp_java. Data in the volume pgdata-<edition>.
redislocalhost:6355Cache. It keeps nothing that has to survive a restart.
miniolocalhost:9200, console on 9201Only in docker-compose.enterprise.yml. Data in the volume minio-enterprise.
ServicioDirección en el servidorNotas
frontendhttp://localhost:80La aplicación de administración. Espera a backend.
backendhttp://localhost:8222La aplicación. Espera a que la base de datos y la caché respondan.
postgreslocalhost:5444Base de datos ks_erp_java. Datos en el volumen pgdata-<edición>.
redislocalhost:6355Caché. No guarda nada que tenga que sobrevivir a un reinicio.
miniolocalhost:9200, consola en 9201Solo en docker-compose.enterprise.yml. Datos en el volumen minio-enterprise.

Step 1: the secrets file

Paso 1: el archivo de secretos

Create a file named .env next to the Compose file, with these three lines. Compose refuses to start without them.

Creá un archivo llamado .env al lado del archivo Compose, con estas tres líneas. Compose se niega a arrancar sin ellas.

Line in .envHow to generate the value
PMS_SECURITY_JWT_SECRET=<your-value>openssl rand -base64 64
PMS_SECURITY_TOTP_ENCRYPTION_KEY=<your-value>openssl rand -base64 32 | cut -c1-32 (32 characters)
KUBRIK_WORKFLOW_SECRET_KEY=<your-value>openssl rand -base64 32
Línea en .envCómo generar el valor
PMS_SECURITY_JWT_SECRET=<tu-valor>openssl rand -base64 64
PMS_SECURITY_TOTP_ENCRYPTION_KEY=<tu-valor>openssl rand -base64 32 | cut -c1-32 (32 caracteres)
KUBRIK_WORKFLOW_SECRET_KEY=<tu-valor>openssl rand -base64 32
⛔
Keep a copy of .env in a safe place. These keys protect the sessions, the two-step verification of every user and the stored access data of external services. If you lose them, that information cannot be read again. See Backups and restore.Guardá una copia de .env en un lugar seguro. Estas claves protegen las sesiones, la verificación en dos pasos de cada usuario y los datos de acceso guardados de servicios externos. Si las perdés, esa información no se puede volver a leer. Mirá Copias de seguridad y restauración.

Step 2: replace the sample passwords

Paso 2: reemplazar las contraseñas de ejemplo

The Compose files come with sample passwords written in them. Open the file of your edition and replace each one with your own value; better still, move them to .env and reference them from the file.

Los archivos Compose traen contraseñas de ejemplo escritas adentro. Abrí el archivo de tu edición y reemplazá cada una por un valor tuyo; mejor todavía, pasalas a .env y referencialas desde el archivo.

Step 3: complete the settings of the application

Paso 3: completar los ajustes de la aplicación

As delivered, the backend service receives the database, the cache and the three secrets. The application also needs its file store, a key for stored access data and the addresses of your site, and it stops during start-up without them. Add to the environment block of backend:

Tal como viene, el servicio backend recibe la base de datos, la caché y los tres secretos. La aplicación además necesita su almacén de archivos, una clave para los datos de acceso guardados y las direcciones de tu sitio, y sin eso se detiene durante el arranque. Agregá al bloque environment de backend:

VariableValue
SPRING_PROFILES_ACTIVEprod,community, prod,professional or prod,enterprise, according to the image.
MINIO_S3_PROVIDERminio, or s3 for Amazon S3.
MINIO_S3_ENDPOINTThe address of the file store. Read the note below before choosing it.
MINIO_S3_BUCKETThe name of the bucket, for example kubrik-os. With MinIO it is created at start-up if it does not exist.
MINIO_S3_INDEX_LOG_BUCKETA second bucket name. Give it a value.
MINIO_S3_REGIONThe region, for example us-east-1.
STORAGE_ACCESS_KEY · STORAGE_SECRET_KEYThe user and the password of the file store.
KSERP_MASTER_KEY_V1The result of openssl rand -base64 32.
APP_CORS_ALLOWED_ORIGINSThe public address of the administration app, for example https://erp.example.com.
APP_BASE_URLThe public address through which the application is reached.
APP_MAIL_TRANSPORTsmtp, graph or log. See Optional services.
APP_MAIL_VERIFICATION_LINK_BASEThe address of the administration app followed by /verify-email.
ELASTICSEARCH_URIS · ELASTICSEARCH_USERNAME · ELASTICSEARCH_PASSWORDGive them any value. No function of this version queries a search server.
VariableValor
SPRING_PROFILES_ACTIVEprod,community, prod,professional o prod,enterprise, según la imagen.
MINIO_S3_PROVIDERminio, o s3 para Amazon S3.
MINIO_S3_ENDPOINTLa dirección del almacén de archivos. Leé la nota de abajo antes de elegirla.
MINIO_S3_BUCKETEl nombre del bucket, por ejemplo kubrik-os. Con MinIO se crea al arrancar si no existe.
MINIO_S3_INDEX_LOG_BUCKETUn segundo nombre de bucket. Dale un valor.
MINIO_S3_REGIONLa región, por ejemplo us-east-1.
STORAGE_ACCESS_KEY · STORAGE_SECRET_KEYEl usuario y la contraseña del almacén de archivos.
KSERP_MASTER_KEY_V1El resultado de openssl rand -base64 32.
APP_CORS_ALLOWED_ORIGINSLa dirección pública de la aplicación de administración, por ejemplo https://erp.example.com.
APP_BASE_URLLa dirección pública por la que se llega a la aplicación.
APP_MAIL_TRANSPORTsmtp, graph o log. Mirá Servicios opcionales.
APP_MAIL_VERIFICATION_LINK_BASELa dirección de la aplicación de administración seguida de /verify-email.
ELASTICSEARCH_URIS · ELASTICSEARCH_USERNAME · ELASTICSEARCH_PASSWORDDales cualquier valor. Ninguna función de esta versión consulta un servidor de búsqueda.
⚠️
The file store address has to work from the browser too. The application signs download links with the address you give in MINIO_S3_ENDPOINT, and people open those links from their own computers. An internal name such as http://minio:9000 works for uploads but produces links nobody outside the server can open. Publish the file store under an address that both the application and the users can reach, and use that one.La dirección del almacén tiene que funcionar también desde el navegador. La aplicación firma los enlaces de descarga con la dirección que pongas en MINIO_S3_ENDPOINT, y la gente abre esos enlaces desde su propia computadora. Un nombre interno como http://minio:9000 sirve para subir archivos pero genera enlaces que nadie fuera del servidor puede abrir. Publicá el almacén bajo una dirección a la que lleguen tanto la aplicación como los usuarios, y usá esa.
ℹ️
The variables MINIO_ENDPOINT, MINIO_ACCESS_KEY and MINIO_SECRET_KEY that the Enterprise file brings are not read by the application. Use the names of the table above. The Community and Professional files bring no file store: copy the minio service and its volume from the Enterprise file, or point the application at an Amazon S3 bucket.Las variables MINIO_ENDPOINT, MINIO_ACCESS_KEY y MINIO_SECRET_KEY que trae el archivo de Enterprise no las lee la aplicación. Usá los nombres de la tabla de arriba. Los archivos de Community y Professional no traen almacén de archivos: copiá el servicio minio y su volumen del archivo de Enterprise, o apuntá la aplicación a un bucket de Amazon S3.

The meaning, the default and the rules of every variable are in the Configuration reference.

El significado, el valor de fábrica y las reglas de cada variable están en la Referencia de configuración.

Step 4: start

Paso 4: arrancar

  1. Start the services. docker compose -f docker-compose.professional.yml up (use the file of your edition). Add -d at the end to leave them running in the background.
  2. Wait for the application. The first start creates the whole database and takes longer than the following ones.
  3. Check the application. curl http://localhost:8222/actuator/info answers with the edition.
  4. Open the administration app at http://localhost:80. You see the sign-in screen.
  1. Levantá los servicios. docker compose -f docker-compose.professional.yml up (usá el archivo de tu edición). Agregá -d al final para dejarlos corriendo en segundo plano.
  2. Esperá a la aplicación. El primer arranque crea toda la base de datos y tarda más que los siguientes.
  3. Revisá la aplicación. curl http://localhost:8222/actuator/info contesta con la edición.
  4. Abrí la aplicación de administración en http://localhost:80. Ves la pantalla de ingreso.
⚠️
The Compose files publish the database, the cache and the file store on the server's ports. On a server reachable from other networks, remove those ports lines or close the ports in the firewall: only the administration app has to be reachable by the users.Los archivos Compose publican la base de datos, la caché y el almacén de archivos en los puertos del servidor. En un servidor al que se llega desde otras redes, quitá esas líneas de ports o cerrá los puertos en el firewall: los usuarios solo necesitan llegar a la aplicación de administración.

Without Docker Compose

Sin Docker Compose

The same two images run on Kubernetes or on any other container platform. Give the application the same variables, check it at /actuator/health on port 8222, and route /api, /ws and /graphql to it. The nginx inside the administration image forwards /api/ to a host named backend, so either name the application service that way or do the routing in your own entry point.

Las mismas dos imágenes corren en Kubernetes o en cualquier otra plataforma de contenedores. Dale a la aplicación las mismas variables, controlala en /actuator/health en el puerto 8222, y dirigí /api, /ws y /graphql hacia ella. El nginx que trae la imagen de administración reenvía /api/ a un host llamado backend, así que o bien le ponés ese nombre al servicio de la aplicación o hacés el ruteo en tu propio punto de entrada.

Common issues

Problemas habituales

"set PMS_SECURITY_JWT_SECRET in .env (openssl rand -base64 64)"
Compose did not find the variable. Create .env next to the Compose file, or run the command from that folder. The same message exists for PMS_SECURITY_TOTP_ENCRYPTION_KEY and KUBRIK_WORKFLOW_SECRET_KEY.
The backend container starts and stops again and again
A required setting is missing or wrong. Read the reason with docker compose -f docker-compose.<edition>.yml logs backend and look it up in Troubleshooting.
A port is already in use
Another program uses 80, 8222, 5444, 6355, 9200 or 9201. Stop it, or change the left-hand number of the ports line of that service.
The sign-in screen opens but every action fails
The application is not answering. Check curl http://localhost:8222/actuator/health and the log of backend.
«set PMS_SECURITY_JWT_SECRET in .env (openssl rand -base64 64)»
Compose no encontró la variable. Creá .env al lado del archivo Compose, o corré el comando desde esa carpeta. El mismo mensaje existe para PMS_SECURITY_TOTP_ENCRYPTION_KEY y KUBRIK_WORKFLOW_SECRET_KEY.
El contenedor backend arranca y se detiene una y otra vez
Falta un ajuste obligatorio o está mal. Leé el motivo con docker compose -f docker-compose.<edición>.yml logs backend y buscalo en Solución de problemas.
Un puerto ya está en uso
Otro programa usa 80, 8222, 5444, 6355, 9200 o 9201. Detenelo, o cambiá el número de la izquierda en la línea ports de ese servicio.
La pantalla de ingreso abre pero todo falla
La aplicación no está contestando. Revisá curl http://localhost:8222/actuator/health y el registro de backend.

RelatedRelacionado