|
| 1 | +# CDN Assets |
| 2 | + |
| 3 | +This folder contains assets that are served directly by MinIO via volume mapping for use in email templates and other static content. |
| 4 | + |
| 5 | +**Note**: Files in this folder are directly accessible to the MinIO container via volume mapping - no upload process needed! |
| 6 | + |
| 7 | +## Files Included |
| 8 | + |
| 9 | +### Static Directory (`static/`) |
| 10 | +- `logo.png` - Company logo for email headers (150x45px recommended) |
| 11 | +- `header.png` - Header image for emails |
| 12 | +- `footer.png` - Footer image for emails |
| 13 | +- `logo.svg` - Vector version of the logo |
| 14 | +- `logo-placeholder.png` - Placeholder logo image |
| 15 | +- `icons/email-icon.png` - Email-related icons |
| 16 | + |
| 17 | +### Root Directory |
| 18 | +- `email-header.jpg` - Header image for email templates (600x200px recommended) |
| 19 | +- `company-icon.svg` - Scalable company icon |
| 20 | +- `email-footer.png` - Footer image for email branding (600x100px recommended) |
| 21 | + |
| 22 | +## How to Use |
| 23 | + |
| 24 | +### 1. Start MinIO |
| 25 | +```bash |
| 26 | +docker-compose -f .devcontainer/docker-compose.dev.yml up -d |
| 27 | +``` |
| 28 | + |
| 29 | +### 2. Access via Public URLs |
| 30 | +Once MinIO is running, you can access these assets directly via: |
| 31 | +- `http://localhost:9000/public-assets/static/logo.png` |
| 32 | +- `http://localhost:9000/public-assets/static/header.png` |
| 33 | +- `http://localhost:9000/public-assets/static/footer.png` |
| 34 | +- `http://localhost:9000/public-assets/email-header.jpg` |
| 35 | +- `http://localhost:9000/public-assets/company-icon.svg` |
| 36 | +- `http://localhost:9000/public-assets/email-footer.png` |
| 37 | + |
| 38 | +### 3. Use in Email Templates |
| 39 | +In your email templates, use the environment variable: |
| 40 | +```javascript |
| 41 | +const logoUrl = `${process.env.CDN_URL}/static/logo.png`; |
| 42 | +// Results in: http://localhost:9000/public-assets/static/logo.png |
| 43 | +``` |
| 44 | + |
| 45 | +## Replacing with Real Assets |
| 46 | + |
| 47 | +To use real image files: |
| 48 | +1. Replace the placeholder files with actual PNG/JPG/SVG files |
| 49 | +2. Keep the same filenames |
| 50 | +3. Restart MinIO: `docker-compose -f .devcontainer/docker-compose.dev.yml restart minio` |
| 51 | + |
| 52 | +## Production Setup |
| 53 | + |
| 54 | +For production, update the `CDN_URL` environment variable to point to your production CDN: |
| 55 | +```bash |
| 56 | +CDN_URL=https://your-cdn-domain.com/assets |
| 57 | +``` |
0 commit comments