docker build -t your-image-name:tag . # EPS to SVG Converter Service A Docker-based web service that converts EPS files to optimized SVG files and uploads them to Huawei Cloud OBS. ## Features - HTTP endpoint for uploading EPS files (max 10MB) - Converts EPS to SVG using eps2svg - Optimizes SVG using scour - Uploads processed files to Huawei Cloud OBS - Includes health check endpoint ## Prerequisites - Docker - Huawei Cloud OBS account credentials ## Setup 1. Copy `.env.example` to `.env` and fill in your OBS credentials: ```bash cp .env.example .env ``` 2. Edit `.env` with your Huawei Cloud OBS credentials: ``` OBS_ACCESS_KEY=your_access_key OBS_SECRET_KEY=your_secret_key OBS_ENDPOINT=your_obs_endpoint OBS_BUCKET=your_bucket_name ``` 3. Build the Docker image: ```bash docker build -t eps2svg . ``` 4. Run the container: ```bash docker run -p 8000:8000 --env-file .env eps2svg ``` ## API Endpoints ### POST /convert Converts an EPS file to SVG and uploads it to OBS. - Method: POST - Content-Type: multipart/form-data - Max file size: 10MB - Accepts: .eps files only Example response: ```json { "status": "success", "message": "File processed successfully", "obs_key": "svg/filename.svg" } ``` ### GET /health Health check endpoint. Response: ```json { "status": "healthy" } ``` ## Error Handling The service returns appropriate HTTP status codes and error messages: - 400: Invalid file type or file too large - 500: Processing or upload errors ## Implementation Details 1. File Upload: Accepts EPS files through HTTP endpoint 2. Processing: - eps2svg converts EPS to SVG - scour optimizes the SVG output 3. Storage: Processed files are uploaded to Huawei Cloud OBS 4. Cleanup: Temporary files are removed after processing