DOC-03: Deployment, Security, and Commissioning
Tactical procedure and security best practices for local permission provisioning, immutable secret generation, and controlled startup of the Redmine stack.
1. Permission Management (Critical Step in Linux)
Sección titulada «1. Gestión de Permisos (Paso Crítico en Linux)»Unlike other file systems in testing environments, volumes mounted within containers in corporate Linux environments require strict ownership and permission assignment to ensure security. The Redmine internal engine executes its threads under an isolated system user with the identifier (UID/GID) 999.
If we omit the ownership change on the Ubuntu host, the application will start, but it will fail immediately when attempting to write attachments, compile custom stylesheets, or dump log traces, causing silent exceptions in the database.
Before initializing the infrastructure, execute the permission sanitization command from the working directory in the host terminal:
cd ~/redmine
# Saneamiento recursivo de carpetas expuestas al contenedorsudo chown -R 999:999 files themes plugins mysql_data config[!WARNING] Access Security: Under no circumstances should you assign global permissive permissions like
chmod -R 777to these folders in enterprise environments. This would open serious vulnerability vectors for remote file injection if any Redmine plugin were to have security breaches.
2. Immutable Secret Generation (Rails Sessions)
Sección titulada «2. Generación Inmutable de Secretos (Sesiones Rails)»Redmine stores session tokens in an encrypted manner in client cookies using the declarative key SECRET_KEY_BASE. To prevent session hijacking or malicious interception in the browser, this key must be high-entropy and kept completely immutable and secret.
If in the future you need to regenerate the key due to a periodic cybersecurity audit, execute the secure cryptographic randomness command:
openssl rand -hex 64Copy the resulting alphanumeric block and immediately update the SECRET_KEY_BASE variable in your docker-compose.yml file before the stack restart.
3. Stack Deployment
Sección titulada «3. Puesta en Marcha del Stack»To compile, structure, and spin up isolated network dependencies and persistence containers in daemon mode (background):
cd ~/redminedocker compose up -dDocker Compose will automatically create the virtual networks, mount the configured volumes, and wait for the MySQL database engine to be ready to initialize the Redmine SQL structure.
4. Status Diagnosis and Log Traces
Sección titulada «4. Diagnóstico de Estado y Trazas de Logs»Ensure the correct startup of services using tactical debugging commands:
4.1. Active Container Verification
Sección titulada «4.1. Verificación de Contenedores Activos»docker compose psSuccess Criterion: Both containers (redmine and redmine_db) must show the status Up or healthy.
4.2. Real-Time Trace Auditing
Sección titulada «4.2. Auditoría de Trazas en Tiempo Real»To analytically monitor the database initialization process and the internal table migration executed by Rails:
docker compose logs -f redmineExpected Output: Look for the active socket logs at the end of the flow:
Listening on 0.0.0.0:3000 (which is externally mapped to the corporate secure port 5588).
5. Common Conflict Resolution (Troubleshooting)
Sección titulada «5. Resolución de Conflictos Comunes (Troubleshooting)»5.1. Container Enters a Restart Loop
Sección titulada «5.1. El Contenedor Entra en un Loop de Reinicios»- Frequent Causes:
- Missing owner permissions in the host's shared directories (omission of the
chowncommand). - Syntax indentation errors in the
docker-compose.ymlYAML file.
- Missing owner permissions in the host's shared directories (omission of the
- Solution: Stop the engine (
docker compose down), verify detailed socket error logs viadocker compose logs, and rerun the permission correction withchown -R 999:999.
5.2. Database Connection Error
Sección titulada «5.2. Error en la Conexión de la Base de Datos»- Frequent Cause:
- The name assigned to the
REDMINE_DB_MYSQLvariable does not exactly match the service name declaration in the Compose file.
- The name assigned to the
- Solution: Open the orchestration file and ensure both blocks share the unified DNS identifier:
redmine_db.
📊 Deployment Success Checklist
Sección titulada «📊 Checklist de Éxito en el Despliegue»- ✓ Correct File Ownership: All mounted directories configured with UID/GID
999to prevent write exceptions. - ✓ Robust Session Secrets:
SECRET_KEY_BASEvariable generated with OpenSSL and isolated from public environments. - ✓ Active Network Sockets: Secure mapping on port
5588responding correctly with Rails log redirection. - ✓ Coupled Orchestration: Main application service prevented from immediate startup via
depends_ondirective until successful MySQL initialization.

