Docker Initialization Guide¶
Overview¶
This guide explains how to initialize and run KrakenHashes using Docker. KrakenHashes runs as a single container that includes the frontend, backend, and PostgreSQL database.
Prerequisites¶
- Docker 20.10.0 or higher
- Docker Compose v2.0.0 or higher
- At least 4GB of free disk space
Environment Configuration¶
The application uses a single .env
file for all configuration. Copy the .env.example
file:
Important Environment Variables¶
Logging Configuration¶
DEBUG
: Set to 'true' or '1' to enable debug outputLOG_LEVEL
: Controls message verbosity (DEBUG, INFO, WARNING, ERROR)DEBUG_SQL
: Enable SQL query loggingDEBUG_HTTP
: Enable HTTP request/response loggingDEBUG_WEBSOCKET
: Enable WebSocket message loggingDEBUG_AUTH
: Enable authentication debuggingDEBUG_JOBS
: Enable job processing debugging
Log File Locations¶
All logs are written to both stdout/stderr and files within the container: - /var/log/krakenhashes/
: Base log directory mounted from host - backend/
: Backend service logs - frontend/
: Frontend service logs - nginx/
: Nginx access and error logs - postgres/
: PostgreSQL logs
Starting the Service¶
-
Build and start the service:
-
Verify the service is running:
Debugging¶
Viewing Logs¶
-
Real-time container logs:
-
Access log files directly from host machine:
Common Issues¶
- Database Connection Issues
- Check PostgreSQL logs in
/var/log/krakenhashes/postgres/
- Verify database credentials in .env
-
Ensure database port is not in use
-
Certificate Issues
- Verify TLS configuration in .env
- Check certificate paths
- Ensure proper permissions on certificate files
Maintenance¶
Database Backups¶
PostgreSQL data is persisted in a named volume. To backup:
Log Rotation¶
Logs are automatically rotated using logrotate with the following policy: - Maximum size: 100MB - Retention: 30 days - Compression: enabled
Security Notes¶
- Change default passwords in .env
- Secure the log directory permissions
- Regular security updates
- Monitor log files for suspicious activity