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.
What each file starts
Qué levanta cada archivo
| Service | Address on the server | Notes |
|---|---|---|
| frontend | http://localhost:80 | The administration app. It waits for backend. |
| backend | http://localhost:8222 | The application. It waits until the database and the cache answer. |
| postgres | localhost:5444 | Database ks_erp_java. Data in the volume pgdata-<edition>. |
| redis | localhost:6355 | Cache. It keeps nothing that has to survive a restart. |
| minio | localhost:9200, console on 9201 | Only in docker-compose.enterprise.yml. Data in the volume minio-enterprise. |
| Servicio | Dirección en el servidor | Notas |
|---|---|---|
| frontend | http://localhost:80 | La aplicación de administración. Espera a backend. |
| backend | http://localhost:8222 | La aplicación. Espera a que la base de datos y la caché respondan. |
| postgres | localhost:5444 | Base de datos ks_erp_java. Datos en el volumen pgdata-<edición>. |
| redis | localhost:6355 | Caché. No guarda nada que tenga que sobrevivir a un reinicio. |
| minio | localhost:9200, consola en 9201 | Solo 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 .env | How 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 .env | Có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 |
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.
- The database password: POSTGRES_PASSWORD in postgres, and SPRING_R2DBC_PASSWORD and SPRING_FLYWAY_PASSWORD in backend. The three must be the same value.
- In the Enterprise file, the file store password: MINIO_ROOT_PASSWORD in minio.
- In the Enterprise file, the sample value of KSERP_MASTER_KEY_V1: generate your own with openssl rand -base64 32.
- La contraseña de la base de datos: POSTGRES_PASSWORD en postgres, y SPRING_R2DBC_PASSWORD y SPRING_FLYWAY_PASSWORD en backend. Las tres tienen que ser el mismo valor.
- En el archivo de Enterprise, la contraseña del almacén de archivos: MINIO_ROOT_PASSWORD en minio.
- En el archivo de Enterprise, el valor de ejemplo de KSERP_MASTER_KEY_V1: generá el tuyo con openssl rand -base64 32.
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:
| Variable | Value |
|---|---|
| SPRING_PROFILES_ACTIVE | prod,community, prod,professional or prod,enterprise, according to the image. |
| MINIO_S3_PROVIDER | minio, or s3 for Amazon S3. |
| MINIO_S3_ENDPOINT | The address of the file store. Read the note below before choosing it. |
| MINIO_S3_BUCKET | The 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_BUCKET | A second bucket name. Give it a value. |
| MINIO_S3_REGION | The region, for example us-east-1. |
| STORAGE_ACCESS_KEY · STORAGE_SECRET_KEY | The user and the password of the file store. |
| KSERP_MASTER_KEY_V1 | The result of openssl rand -base64 32. |
| APP_CORS_ALLOWED_ORIGINS | The public address of the administration app, for example https://erp.example.com. |
| APP_BASE_URL | The public address through which the application is reached. |
| APP_MAIL_TRANSPORT | smtp, graph or log. See Optional services. |
| APP_MAIL_VERIFICATION_LINK_BASE | The address of the administration app followed by /verify-email. |
| ELASTICSEARCH_URIS · ELASTICSEARCH_USERNAME · ELASTICSEARCH_PASSWORD | Give them any value. No function of this version queries a search server. |
| Variable | Valor |
|---|---|
| SPRING_PROFILES_ACTIVE | prod,community, prod,professional o prod,enterprise, según la imagen. |
| MINIO_S3_PROVIDER | minio, o s3 para Amazon S3. |
| MINIO_S3_ENDPOINT | La dirección del almacén de archivos. Leé la nota de abajo antes de elegirla. |
| MINIO_S3_BUCKET | El nombre del bucket, por ejemplo kubrik-os. Con MinIO se crea al arrancar si no existe. |
| MINIO_S3_INDEX_LOG_BUCKET | Un segundo nombre de bucket. Dale un valor. |
| MINIO_S3_REGION | La región, por ejemplo us-east-1. |
| STORAGE_ACCESS_KEY · STORAGE_SECRET_KEY | El usuario y la contraseña del almacén de archivos. |
| KSERP_MASTER_KEY_V1 | El resultado de openssl rand -base64 32. |
| APP_CORS_ALLOWED_ORIGINS | La dirección pública de la aplicación de administración, por ejemplo https://erp.example.com. |
| APP_BASE_URL | La dirección pública por la que se llega a la aplicación. |
| APP_MAIL_TRANSPORT | smtp, graph o log. Mirá Servicios opcionales. |
| APP_MAIL_VERIFICATION_LINK_BASE | La dirección de la aplicación de administración seguida de /verify-email. |
| ELASTICSEARCH_URIS · ELASTICSEARCH_USERNAME · ELASTICSEARCH_PASSWORD | Dales cualquier valor. Ninguna función de esta versión consulta un servidor de búsqueda. |
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
- 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.
- Wait for the application. The first start creates the whole database and takes longer than the following ones.
- Check the application. curl http://localhost:8222/actuator/info answers with the edition.
- Open the administration app at http://localhost:80. You see the sign-in screen.
- 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.
- Esperá a la aplicación. El primer arranque crea toda la base de datos y tarda más que los siguientes.
- Revisá la aplicación. curl http://localhost:8222/actuator/info contesta con la edición.
- Abrí la aplicación de administración en http://localhost:80. Ves la pantalla de ingreso.
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.