diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 80c5613..6b335b5 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,11 +7,15 @@ RUN npm ci --ignore-scripts COPY frontend/ . -# Build the SvelteKit app (stub for Gate B — will be updated when SvelteKit scaffolds) -# For now, copy a stub HTML page. Vite build runs in production mode later. -RUN mkdir -p build && \ - echo '
SvelteKit app stub. Update this Dockerfile when the SvelteKit app is scaffolded.
' > build/index.html +RUN npm run build +# adapter-static outputs to build/ EXPOSE 80 -CMD ["node", "-e", "const h=require('http'),fs=require('fs'),url=require('url');h.createServer((req,res)=>{const f='build/index.html';res.writeHead(200,{'Content-Type':'text/html'}).end(fs.readFileSync(f))}).listen(80);console.log('frontend on :80')"] +CMD ["node", "-e", "\ +const h=require('http'),fs=require('fs'),url=require('url'),path=require('path');\ +const root='build';\ +const types={'/':'application/json','js':'application/javascript','css':'text/css','html':'text/html','json':'application/json','svg':'image/svg+xml','png':'image/png','jpg':'image/jpeg','jpeg':'image/jpeg','ico':'image/x-icon','woff2':'font/woff2','woff':'font/woff','ttf':'font/ttf','otf':'font/otf','map':'application/json'};\ +h.createServer((req,res)=>{const p=url.parse(req.url||'/').pathname||'/';const fp=path.join(root,p==='/'?'/index.html':p);try{const s=fs.statSync(fp);if(s.isDirectory()){fs.readFile(path.join(fp,'index.html'),'utf8',(e,d)=>{res.writeHead(200,{'Content-Type':'text/html'});res.end(d||'Select 1–5 photos of the slab. Supported: JPG, PNG, WEBP.
+Adjust knobs to refine the mask. Green overlay shows the detected slab.
+Confirm the length direction. Rotate in 90° increments if needed.
+Enter the slab's length, thickness, and SKU. Values are computed automatically.
+Review the values. If correct, upload to create a calibrated draft.
+ + {#if state.uploaded} +Slab ID: {state.reviewData?.id}
Server Rev: {state.reviewData?.serverRev}
+ +{state.uploadError}
+ +