cyclecad 2.1.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/BILLING-IMPLEMENTATION-SUMMARY.md +425 -0
  2. package/BILLING-INDEX.md +293 -0
  3. package/BILLING-INTEGRATION-GUIDE.md +414 -0
  4. package/COLLABORATION-INDEX.md +440 -0
  5. package/COLLABORATION-SYSTEM-SUMMARY.md +548 -0
  6. package/DELIVERABLES.txt +296 -445
  7. package/DOCKER-BUILD-MANIFEST.txt +483 -0
  8. package/DOCKER-FILES-REFERENCE.md +440 -0
  9. package/DOCKER-INFRASTRUCTURE.md +475 -0
  10. package/DOCKER-README.md +435 -0
  11. package/Dockerfile +33 -55
  12. package/ENHANCEMENT_COMPLETION_REPORT.md +383 -0
  13. package/ENHANCEMENT_SUMMARY.txt +308 -0
  14. package/FEATURE_INVENTORY.md +235 -0
  15. package/FUSION360_FEATURES_SUMMARY.md +452 -0
  16. package/FUSION360_PARITY_ENHANCEMENTS.md +461 -0
  17. package/FUSION360_PARITY_SUMMARY.md +520 -0
  18. package/FUSION360_QUICK_REFERENCE.md +351 -0
  19. package/MODULE_API_REFERENCE.md +712 -0
  20. package/MODULE_INVENTORY.txt +264 -0
  21. package/PWA-FILES-CREATED.txt +350 -0
  22. package/QUICK-START-TESTING.md +126 -0
  23. package/STEP-IMPORT-QUICKSTART.md +347 -0
  24. package/STEP-IMPORT-SYSTEM-SUMMARY.md +502 -0
  25. package/app/css/mobile.css +1074 -0
  26. package/app/icons/generate-icons.js +203 -0
  27. package/app/index.html +1342 -5031
  28. package/app/js/app.js +1312 -514
  29. package/app/js/billing-ui.js +990 -0
  30. package/app/js/brep-kernel.js +933 -981
  31. package/app/js/collab-client.js +750 -0
  32. package/app/js/mobile-nav.js +623 -0
  33. package/app/js/mobile-toolbar.js +476 -0
  34. package/app/js/modules/animation-module.js +497 -3
  35. package/app/js/modules/billing-module.js +724 -0
  36. package/app/js/modules/cam-module.js +507 -2
  37. package/app/js/modules/collaboration-module.js +513 -0
  38. package/app/js/modules/constraint-module.js +1266 -0
  39. package/app/js/modules/data-module.js +544 -1146
  40. package/app/js/modules/formats-module.js +438 -738
  41. package/app/js/modules/inspection-module.js +393 -0
  42. package/app/js/modules/mesh-module-enhanced.js +880 -0
  43. package/app/js/modules/plugin-module.js +597 -0
  44. package/app/js/modules/rendering-module.js +460 -0
  45. package/app/js/modules/scripting-module.js +593 -475
  46. package/app/js/modules/sketch-module.js +998 -2
  47. package/app/js/modules/step-module-enhanced.js +938 -0
  48. package/app/js/modules/surface-module.js +312 -0
  49. package/app/js/modules/version-module.js +420 -0
  50. package/app/js/offline-manager.js +705 -0
  51. package/app/js/responsive-init.js +360 -0
  52. package/app/js/touch-handler.js +429 -0
  53. package/app/manifest.json +211 -0
  54. package/app/offline.html +508 -0
  55. package/app/sw.js +571 -0
  56. package/app/tests/billing-tests.html +779 -0
  57. package/app/tests/brep-tests.html +980 -0
  58. package/app/tests/collab-tests.html +743 -0
  59. package/app/tests/mobile-tests.html +1299 -0
  60. package/app/tests/pwa-tests.html +1134 -0
  61. package/app/tests/step-tests.html +1042 -0
  62. package/app/tests/test-agent-v3.html +719 -0
  63. package/cycleCAD-Architecture-v2.pptx +0 -0
  64. package/docker-compose.yml +225 -0
  65. package/docs/BILLING-HELP.json +260 -0
  66. package/docs/BILLING-README.md +639 -0
  67. package/docs/BILLING-TUTORIAL.md +736 -0
  68. package/docs/BREP-HELP.json +326 -0
  69. package/docs/BREP-TUTORIAL.md +802 -0
  70. package/docs/COLLABORATION-HELP.json +228 -0
  71. package/docs/COLLABORATION-TUTORIAL.md +818 -0
  72. package/docs/DOCKER-HELP.json +224 -0
  73. package/docs/DOCKER-TUTORIAL.md +974 -0
  74. package/docs/MOBILE-HELP.json +243 -0
  75. package/docs/MOBILE-RESPONSIVE-README.md +378 -0
  76. package/docs/MOBILE-TUTORIAL.md +747 -0
  77. package/docs/PWA-HELP.json +228 -0
  78. package/docs/PWA-README.md +662 -0
  79. package/docs/PWA-TUTORIAL.md +757 -0
  80. package/docs/STEP-HELP.json +481 -0
  81. package/docs/STEP-IMPORT-TUTORIAL.md +824 -0
  82. package/docs/TESTING-GUIDE.md +528 -0
  83. package/docs/TESTING-HELP.json +182 -0
  84. package/fusion-vs-cyclecad.html +1771 -0
  85. package/nginx.conf +237 -0
  86. package/package.json +1 -1
  87. package/server/Dockerfile.converter +51 -0
  88. package/server/Dockerfile.signaling +28 -0
  89. package/server/billing-server.js +487 -0
  90. package/server/converter-enhanced.py +528 -0
  91. package/server/requirements-converter.txt +29 -0
  92. package/server/signaling-server.js +801 -0
  93. package/tests/docker-tests.sh +389 -0
  94. package/~$cycleCAD-Architecture-v2.pptx +0 -0
@@ -0,0 +1,435 @@
1
+ # cycleCAD Docker Infrastructure
2
+
3
+ ## Overview
4
+
5
+ Complete Docker infrastructure for cycleCAD, featuring:
6
+
7
+ - **4 Production-Ready Services** — Web app, STEP converter, real-time signaling, optional viewer
8
+ - **End-to-End Testing** — 15+ test categories with automated CI/CD
9
+ - **Comprehensive Documentation** — 600+ line tutorial + API reference + deployment guides
10
+ - **Resource Management** — Memory limits, health checks, logging, monitoring
11
+ - **CI/CD Pipeline** — GitHub Actions with build, test, and publish workflows
12
+
13
+ ### Architecture
14
+
15
+ ```
16
+ ┌─────────────────────────────────────────────────────────────────┐
17
+ │ Docker Infrastructure │
18
+ ├─────────────────────────────────────────────────────────────────┤
19
+ │ │
20
+ │ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────┐ │
21
+ │ │ cycleCAD │ │ STEP Converter │ │ Signaling │ │
22
+ │ │ (Nginx) │ │ (FastAPI) │ │ (Node.js) │ │
23
+ │ │ Port 8080 │ │ Port 8787 │ │ Port 8788 │ │
24
+ │ │ 512MB RAM │ │ 4GB RAM │ │ 512MB RAM │ │
25
+ │ └──────────────────┘ └──────────────────┘ └──────────────┘ │
26
+ │ │
27
+ │ ┌──────────────────┐ │
28
+ │ │ ExplodeView │ (Optional, Port 3000) │
29
+ │ │ (Nginx - viewer)│ │
30
+ │ │ 256MB RAM │ │
31
+ │ └──────────────────┘ │
32
+ │ │
33
+ │ Docker Network: cyclecad-network (172.28.0.0/16) │
34
+ │ Volumes: db-data, redis-data (future) │
35
+ │ Health Checks: All services with 30s intervals │
36
+ │ │
37
+ └─────────────────────────────────────────────────────────────────┘
38
+ ```
39
+
40
+ ## Quick Start
41
+
42
+ ### 1. Prerequisites
43
+
44
+ - **Mac/Windows**: Docker Desktop v4.0+ ([Download](https://www.docker.com/products/docker-desktop))
45
+ - **Linux**: Docker Engine + docker-compose
46
+ - **Resources**: 4GB RAM minimum, 8GB recommended
47
+ - **Ports**: 8080, 8787, 8788 available
48
+
49
+ ### 2. Start Services
50
+
51
+ ```bash
52
+ cd ~/cyclecad
53
+ docker-compose up -d
54
+ docker-compose ps # Check status (should show 3 healthy services)
55
+ ```
56
+
57
+ ### 3. Access Applications
58
+
59
+ | Service | URL | Purpose |
60
+ |---------|-----|---------|
61
+ | **cycleCAD** | http://localhost:8080 | CAD modeler + landing page |
62
+ | **Converter API** | http://localhost:8787/docs | OpenAPI documentation |
63
+ | **Signaling** | ws://localhost:8788 | WebSocket for real-time features |
64
+ | **ExplodeView** | http://localhost:3000 | 3D viewer (optional) |
65
+
66
+ ### 4. Verify Health
67
+
68
+ ```bash
69
+ curl http://localhost:8080/health
70
+ curl http://localhost:8787/health
71
+ curl http://localhost:8788/health
72
+ ```
73
+
74
+ Each returns JSON: `{"status":"ok","app":"cyclecad"}`
75
+
76
+ ### 5. Stop Services
77
+
78
+ ```bash
79
+ docker-compose down # Stop and remove containers
80
+ docker-compose down -v # Also remove volumes
81
+ ```
82
+
83
+ ## File Structure
84
+
85
+ ```
86
+ cyclecad/
87
+ ├── Dockerfile # Main web app image
88
+ ├── nginx.conf # Production nginx config (gzip, CORS, security)
89
+ ├── docker-compose.yml # Multi-service orchestration
90
+
91
+ ├── server/
92
+ │ ├── Dockerfile.converter # STEP→GLB conversion service
93
+ │ ├── Dockerfile.signaling # WebSocket signaling server
94
+ │ ├── requirements-converter.txt # Python dependencies
95
+ │ ├── converter.py # FastAPI STEP converter
96
+ │ └── signaling-server.js # Node.js signaling server
97
+
98
+ ├── tests/
99
+ │ └── docker-tests.sh # E2E test suite (15+ tests)
100
+
101
+ ├── docs/
102
+ │ ├── DOCKER-TUTORIAL.md # 600+ line guide (all topics)
103
+ │ ├── DOCKER-HELP.json # JSON help entries (15+ commands)
104
+ │ ├── DEPLOYMENT-K8S.md # Kubernetes setup
105
+ │ └── DEPLOYMENT-ECS.md # AWS ECS setup
106
+
107
+ ├── .github/workflows/
108
+ │ └── docker-test.yml # CI/CD pipeline (build + test + publish)
109
+
110
+ └── app/, index.html, etc. # Application files
111
+ ```
112
+
113
+ ## Key Files
114
+
115
+ ### 1. **Dockerfile** (Production-Ready Web App)
116
+ - Base: `nginx:alpine` (11.5 MB)
117
+ - Serves: Landing page + CAD app (SPA)
118
+ - Features: Gzip, CORS, COOP/COEP headers, caching, security headers
119
+ - Size: ~15 MB when built
120
+ - Health check: `GET /health` → JSON
121
+
122
+ ### 2. **nginx.conf** (Production Nginx Config)
123
+ - Gzip compression on JS, CSS, JSON, WASM, SVG (6+ types)
124
+ - CORS headers: Allow all origins, methods, headers
125
+ - COOP/COEP: Enable SharedArrayBuffer for Web Workers
126
+ - Cache strategy:
127
+ - Static assets (JS/CSS/WASM): 1 year (immutable)
128
+ - HTML: No cache (always validate)
129
+ - API: No cache
130
+ - Security headers: CSP, X-Frame-Options, X-Content-Type-Options
131
+ - Max upload: 500MB (for STEP files)
132
+ - SPA routing: `/app/*` → `/app/index.html`
133
+
134
+ ### 3. **docker-compose.yml** (Multi-Service Orchestration)
135
+ - **cyclecad** (8080) — Nginx web app, 512MB, depends on converter + signaling
136
+ - **converter** (8787) — FastAPI STEP converter, 4GB, 300s timeout
137
+ - **signaling** (8788) — Node.js WebSocket, 512MB, 1000 max connections
138
+ - **explodeview** (3000, optional) — 3D viewer, 256MB
139
+ - Health checks: 30s interval, 5-10s timeout
140
+ - Resource limits: CPU and memory for each service
141
+ - Networks: Isolated `cyclecad-network`
142
+ - Logging: JSON driver with rotation (10-50 MB)
143
+
144
+ ### 4. **docker-tests.sh** (End-to-End Test Suite)
145
+ Comprehensive testing with 30+ tests covering:
146
+
147
+ **Build & Infrastructure:**
148
+ - ✓ docker-compose installed
149
+ - ✓ Docker daemon running
150
+ - ✓ Services startup
151
+ - ✓ Health checks passing
152
+
153
+ **cycleCAD (Port 8080):**
154
+ - ✓ Landing page (/)
155
+ - ✓ CAD app (/app/)
156
+ - ✓ Health endpoint (/health)
157
+ - ✓ CORS headers present
158
+ - ✓ COOP/COEP headers
159
+ - ✓ Gzip compression
160
+ - ✓ Static asset caching
161
+ - ✓ SPA routing (/app/*)
162
+
163
+ **Converter (Port 8787):**
164
+ - ✓ Health check
165
+ - ✓ API documentation (/docs)
166
+ - ✓ /convert endpoint
167
+ - ✓ STEP file upload
168
+ - ✓ GLB response
169
+
170
+ **Signaling (Port 8788):**
171
+ - ✓ Health check
172
+ - ✓ WebSocket upgrade headers
173
+ - ✓ Connection handling
174
+
175
+ **Docker:**
176
+ - ✓ Resource limits
177
+ - ✓ Health check configuration
178
+ - ✓ Network isolation
179
+ - ✓ Service cleanup
180
+
181
+ ### 5. **GitHub Actions Workflow** (docker-test.yml)
182
+ Automated CI/CD pipeline:
183
+
184
+ **On Push to main:**
185
+ 1. Build all images
186
+ 2. Start services with health checks
187
+ 3. Run E2E test suite
188
+ 4. Collect logs and report results
189
+ 5. Publish images to Docker Hub + GitHub Container Registry
190
+ 6. Deploy to VPS (if credentials configured)
191
+
192
+ **Features:**
193
+ - Caching for faster rebuilds
194
+ - Artifact uploads (test logs)
195
+ - Status notifications
196
+ - Conditional deployment
197
+ - 30-minute timeout
198
+
199
+ ## Commands
200
+
201
+ ### Start/Stop
202
+
203
+ ```bash
204
+ docker-compose up -d # Start all services (background)
205
+ docker-compose up # Start all services (foreground, see logs)
206
+ docker-compose stop # Stop services
207
+ docker-compose restart # Restart services
208
+ docker-compose down # Stop and remove containers
209
+ docker-compose down -v # Stop and remove volumes
210
+ ```
211
+
212
+ ### Logs & Monitoring
213
+
214
+ ```bash
215
+ docker-compose logs -f # Stream all logs
216
+ docker-compose logs -f converter # Stream specific service
217
+ docker-compose logs --tail 100 # Last 100 lines
218
+ docker stats # CPU/memory usage
219
+ docker-compose ps # Service status
220
+ ```
221
+
222
+ ### Testing
223
+
224
+ ```bash
225
+ bash tests/docker-tests.sh # Run E2E tests
226
+ curl http://localhost:8080/health # Test health endpoint
227
+ curl -X POST http://localhost:8787/convert \
228
+ -F "file=@model.stp" # Test STEP conversion
229
+ ```
230
+
231
+ ### Development
232
+
233
+ ```bash
234
+ docker-compose exec cyclecad sh # Shell into service
235
+ docker-compose build # Rebuild images
236
+ docker-compose build --no-cache # Full rebuild
237
+ docker images | grep cyclecad # View built images
238
+ ```
239
+
240
+ ### Configuration
241
+
242
+ ```bash
243
+ # Create .env file with custom variables
244
+ cat > .env << EOF
245
+ APP_ENV=production
246
+ LOG_LEVEL=info
247
+ WORKERS=4
248
+ MAX_FILE_SIZE=500
249
+ EOF
250
+
251
+ # Use custom environment file
252
+ docker-compose --env-file custom.env up -d
253
+
254
+ # Override at command line
255
+ WORKERS=8 docker-compose up -d
256
+ ```
257
+
258
+ ## Documentation
259
+
260
+ ### Full Guides
261
+
262
+ 1. **[DOCKER-TUTORIAL.md](docs/DOCKER-TUTORIAL.md)** (600+ lines)
263
+ - Complete reference for all operations
264
+ - Development workflow
265
+ - Production deployment (VPS, AWS, K8S)
266
+ - SSL/TLS with Let's Encrypt
267
+ - Scaling and performance
268
+ - Troubleshooting
269
+
270
+ 2. **[DOCKER-HELP.json](docs/DOCKER-HELP.json)**
271
+ - 15+ help entries (JSON format)
272
+ - Usage examples for each command
273
+ - Searchable for integration with CLIs
274
+
275
+ 3. **[DEPLOYMENT-K8S.md](docs/DEPLOYMENT-K8S.md)** (future)
276
+ - Kubernetes manifests
277
+ - Helm charts
278
+ - Auto-scaling setup
279
+ - Service mesh integration
280
+
281
+ 4. **[DEPLOYMENT-ECS.md](docs/DEPLOYMENT-ECS.md)** (future)
282
+ - AWS ECS task definitions
283
+ - Fargate launch configuration
284
+ - Load balancer setup
285
+ - CI/CD with CodePipeline
286
+
287
+ ## Deployment
288
+
289
+ ### Local Development
290
+ ```bash
291
+ docker-compose up
292
+ # Edit code, see changes instantly (with volume mounts)
293
+ ```
294
+
295
+ ### VPS (DigitalOcean, AWS EC2, Linode)
296
+ ```bash
297
+ ssh user@your-vps
298
+ git clone https://github.com/vvlars-cmd/cyclecad.git
299
+ cd cyclecad
300
+ docker-compose up -d
301
+ ```
302
+
303
+ ### Production with HTTPS
304
+ ```bash
305
+ # With nginx-proxy + ACME (automatic SSL)
306
+ docker-compose -f docker-compose.yml -f docker-compose.ssl.yml up -d
307
+ ```
308
+
309
+ ### Kubernetes
310
+ ```bash
311
+ kubectl apply -f k8s/
312
+ kubectl rollout status deployment/cyclecad
313
+ ```
314
+
315
+ ### AWS Fargate (Managed)
316
+ ```bash
317
+ # See DEPLOYMENT-ECS.md for full setup
318
+ ecs-cli compose service up
319
+ ```
320
+
321
+ ## Troubleshooting
322
+
323
+ ### Services won't start
324
+ ```bash
325
+ docker-compose logs converter
326
+ docker-compose down -v && docker-compose build --no-cache
327
+ ```
328
+
329
+ ### Health checks failing
330
+ ```bash
331
+ curl -v http://localhost:8787/health # Test each service
332
+ docker-compose ps # Check status
333
+ ```
334
+
335
+ ### STEP conversion failing
336
+ ```bash
337
+ docker-compose logs converter -f # Watch converter logs
338
+ # Check file size: < 500MB recommended
339
+ # Check: WORKERS=2, TIMEOUT=300
340
+ ```
341
+
342
+ ### Out of memory
343
+ ```bash
344
+ docker stats # Check usage
345
+ # Increase in docker-compose.yml: memory: 8G
346
+ ```
347
+
348
+ ### Port conflicts
349
+ ```bash
350
+ sudo lsof -i :8080 # Find process using port
351
+ kill -9 <PID> # Kill process
352
+ # Or change ports in docker-compose.yml
353
+ ```
354
+
355
+ ## Performance Tips
356
+
357
+ 1. **Enable BuildKit** for faster builds:
358
+ ```bash
359
+ DOCKER_BUILDKIT=1 docker build .
360
+ ```
361
+
362
+ 2. **Use volume mounts** for hot reload in development:
363
+ ```bash
364
+ docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
365
+ ```
366
+
367
+ 3. **Scale converter** for heavy STEP processing:
368
+ - Add multiple converter instances in docker-compose.yml
369
+ - Use load balancer (HAProxy, nginx-upstream)
370
+
371
+ 4. **Enable caching** in GitHub Actions:
372
+ ```yaml
373
+ cache:
374
+ path: /tmp/.buildx-cache
375
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
376
+ ```
377
+
378
+ 5. **Monitor resource usage**:
379
+ ```bash
380
+ docker stats --no-stream
381
+ docker system df
382
+ ```
383
+
384
+ ## Security
385
+
386
+ - **Isolation**: Services run on isolated network (`cyclecad-network`)
387
+ - **Non-root**: Converter runs as `converter:converter` user (UID 1000)
388
+ - **Memory limits**: Prevents DoS attacks and runaway processes
389
+ - **Headers**: CORS, COOP, COEP, CSP, X-Frame-Options configured
390
+ - **Secrets**: Use `.env` file (add to `.gitignore`)
391
+ - **SSL/TLS**: Use with nginx-proxy for automatic HTTPS
392
+
393
+ ## CI/CD
394
+
395
+ ### GitHub Actions Workflow
396
+ - Triggered on: `push` to main/develop, `pull_request` to main
397
+ - Builds: All images with caching
398
+ - Tests: E2E suite with 30+ tests
399
+ - Publishes: To Docker Hub + GitHub Container Registry
400
+ - Deploys: To VPS (if credentials configured)
401
+
402
+ **Add secrets to GitHub repository:**
403
+ - `DOCKER_USERNAME` — Docker Hub username
404
+ - `DOCKER_PASSWORD` — Docker Hub password
405
+ - `DEPLOY_KEY` — SSH private key (optional)
406
+ - `DEPLOY_USER` — SSH user (optional)
407
+ - `DEPLOY_HOST` — SSH host (optional)
408
+ - `WEBHOOK_URL` — Notification webhook (optional)
409
+
410
+ ## Future Enhancements
411
+
412
+ - [ ] Kubernetes deployment with Helm charts
413
+ - [ ] Database service (PostgreSQL) for user accounts
414
+ - [ ] Redis caching layer
415
+ - [ ] Prometheus metrics and Grafana dashboards
416
+ - [ ] ELK stack for centralized logging
417
+ - [ ] Multi-region deployment strategy
418
+ - [ ] Blue-green deployment for zero-downtime updates
419
+
420
+ ## Support & Contributing
421
+
422
+ - **Issues**: https://github.com/vvlars-cmd/cyclecad/issues
423
+ - **Discussions**: https://github.com/vvlars-cmd/cyclecad/discussions
424
+ - **Email**: vvlars@googlemail.com
425
+ - **Discord**: [Join community](https://discord.gg/cyclecad) (future)
426
+
427
+ ## License
428
+
429
+ MIT License. See LICENSE file in repository.
430
+
431
+ ---
432
+
433
+ **Last Updated**: 2026-03-31
434
+ **Version**: 0.8.6
435
+ **Maintainer**: vvlars (vvlars@googlemail.com)
package/Dockerfile CHANGED
@@ -1,69 +1,47 @@
1
1
  # cycleCAD — Agent-First OS for Manufacturing
2
- # Serves the landing page + app via nginx
2
+ # Production-ready Dockerfile for cyclecad.com
3
3
  #
4
- # Build: docker build -t cyclecad .
5
- # Run: docker run -p 3000:80 cyclecad
6
- # Open: http://localhost:3000 (landing) / http://localhost:3000/app/ (CAD app)
4
+ # Build: docker build -t cyclecad:latest .
5
+ # Tag: docker tag cyclecad:latest cyclecad:v0.8.6
6
+ # Run: docker run -p 8080:80 --name cyclecad cyclecad:latest
7
+ # Health: curl http://localhost:8080/health
8
+ #
9
+ # Features:
10
+ # - Gzip compression (JS, CSS, JSON, WASM, SVG)
11
+ # - CORS headers (all origins, GET/POST/OPTIONS)
12
+ # - COOP/COEP headers (SharedArrayBuffer for Web Workers)
13
+ # - Aggressive caching (1 year for static assets)
14
+ # - Security headers (CSP, X-Frame-Options, X-Content-Type-Options)
15
+ # - SPA fallback (all routes → index.html except /api/ & /health)
16
+ # - Max upload size: 500MB (for STEP file imports)
17
+ # - Health check endpoint: GET /health
7
18
 
8
19
  FROM nginx:alpine
9
20
 
10
- # Copy landing page
21
+ # Install curl for health checks
22
+ RUN apk add --no-cache curl
23
+
24
+ # Copy landing page + assets
11
25
  COPY index.html /usr/share/nginx/html/
12
26
  COPY screenshot.png /usr/share/nginx/html/
13
- COPY competitive-analysis.html /usr/share/nginx/html/
14
- COPY architecture.html /usr/share/nginx/html/
15
-
16
- # Copy app
17
- COPY app/ /usr/share/nginx/html/app/
18
-
19
- # Copy docs if they exist
20
- COPY docs/ /usr/share/nginx/html/docs/
27
+ COPY CNAME /usr/share/nginx/html/
21
28
 
22
- # Custom nginx config
23
- RUN cat > /etc/nginx/conf.d/default.conf << 'NGINX'
24
- server {
25
- listen 80;
26
- server_name _;
27
- root /usr/share/nginx/html;
28
- index index.html;
29
+ # Copy all reference HTML files
30
+ COPY competitive-analysis.html /usr/share/nginx/html/ 2>/dev/null || true
31
+ COPY architecture.html /usr/share/nginx/html/ 2>/dev/null || true
29
32
 
30
- # Enable gzip
31
- gzip on;
32
- gzip_types text/plain text/css application/javascript application/json model/gltf-binary;
33
- gzip_min_length 1000;
34
-
35
- # CORS
36
- add_header Access-Control-Allow-Origin *;
37
- add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
38
-
39
- # Cross-Origin headers for SharedArrayBuffer
40
- add_header Cross-Origin-Opener-Policy same-origin;
41
- add_header Cross-Origin-Embedder-Policy require-corp;
42
-
43
- # Cache
44
- location ~* \.(js|css|png|jpg|svg|woff2|glb|stl|pptx)$ {
45
- expires 7d;
46
- add_header Cache-Control "public, immutable";
47
- }
33
+ # Copy CAD app (all JS modules, assets, etc.)
34
+ COPY app/ /usr/share/nginx/html/app/
48
35
 
49
- # SPA fallback for app
50
- location /app/ {
51
- try_files $uri $uri/ /app/index.html;
52
- }
36
+ # Copy documentation
37
+ COPY docs/ /usr/share/nginx/html/docs/ 2>/dev/null || true
53
38
 
54
- location / {
55
- try_files $uri $uri/ /index.html;
56
- }
39
+ # Copy example Inventor project files (optional, for demos)
40
+ COPY example/ /usr/share/nginx/html/example/ 2>/dev/null || true
57
41
 
58
- # Health check
59
- location /health {
60
- return 200 '{"status":"ok","app":"cyclecad"}';
61
- add_header Content-Type application/json;
62
- }
63
- }
64
- NGINX
42
+ # Copy our production nginx config
43
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
65
44
 
66
45
  EXPOSE 80
67
-
68
- HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
69
- CMD wget -q -O /dev/null http://localhost:80/health || exit 1
46
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
47
+ CMD curl -f http://localhost/health || exit 1