Deployment and Runtime Guide
Prerequisites
- Node.js 18+ (recommended)
- MySQL 5.7+/8.0+
- Optional: PM2 or Docker
Start the Project
- Install dependencies:
npm install - Configure environment variables: copy
.env.exampleto.envand update values - Start:
npm start - Visit:
- Health:
http://localhost:[PORT]/ - Swagger UI (non-production):
http://localhost:[PORT]/openapi
- Health:
PM2 Deployment
Use ecosystem.config.cjs:
npm i -g pm2
pm2 start ecosystem.config.cjs --env production
pm2 status
pm2 logs- Logs:
logs/ - Stop:
pm2 stop umo-office-convert
Docker
See Docker Deployment.
- Note: expose the MySQL service to the container and ensure it is reachable (for example, use host networking or container networking).
Database Preparation
- Create the database and user (example):
CREATE DATABASE IF NOT EXISTS `umo_office_convert` DEFAULT CHARACTER SET utf8mb4; CREATE USER 'convert_user'@'%' IDENTIFIED BY 'strong_password'; GRANT ALL PRIVILEGES ON `umo_office_convert`.* TO 'convert_user'@'%'; FLUSH PRIVILEGES; - After the service starts, it will automatically create the
convert_taskstable.
Runtime Directories
- Original file storage directory (optional)
- Converted document storage directory
- Log directory
Production Recommendations
- Use object storage (S3/OSS) instead of local disks.
- Enable HTTPS and rate limiting via a reverse proxy (such as Nginx).
- Adjust
MAX_FILE_SIZEandFILE_HASH_ALGORITHMto fit business needs.