From b7269601ebf824791fb77531c6495ec299276106 Mon Sep 17 00:00:00 2001 From: Blomios Date: Tue, 21 Apr 2026 08:49:36 +0200 Subject: [PATCH] fix: fix PWA for mobile --- frontend/Dockerfile | 10 +++++++++- frontend/public/icon-source.svg | 13 +++++++++++++ frontend/vite.config.ts | 5 +++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 frontend/public/icon-source.svg diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 290c861..55ff62c 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,10 +1,18 @@ -FROM node:22-alpine AS builder +FROM node:22 AS builder + +RUN apt-get update && apt-get install -y --no-install-recommends librsvg2-bin && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY package.json package-lock.json* ./ RUN npm ci COPY . . + +# Generate PNG icons from SVG source +RUN mkdir -p public/icons && \ + rsvg-convert -w 192 -h 192 public/icon-source.svg -o public/icons/icon-192.png && \ + rsvg-convert -w 512 -h 512 public/icon-source.svg -o public/icons/icon-512.png + RUN npm run build FROM nginx:alpine diff --git a/frontend/public/icon-source.svg b/frontend/public/icon-source.svg new file mode 100644 index 0000000..b12f9f7 --- /dev/null +++ b/frontend/public/icon-source.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 6917efb..ea4897c 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -16,9 +16,10 @@ export default defineConfig({ theme_color: '#0f172a', background_color: '#0f172a', display: 'standalone', + start_url: '/', icons: [ - { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, - { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' }, + { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' }, + { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' }, ], }, workbox: {