File tree Expand file tree Collapse file tree 4 files changed +75
-1
lines changed
Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 11# Use an official Python runtime as a parent image
2- FROM python:3.11-slim-buster
2+ FROM python:3.11-slim-bookworm
33
44# Set the working directory in the container
55WORKDIR /app
66
7+ # Install FFmpeg (required for audio processing)
8+ RUN apt-get update && apt-get install -y --no-install-recommends \
9+ ffmpeg \
10+ && rm -rf /var/lib/apt/lists/*
11+
712# Copy the requirements file into the container at /app
813COPY requirements.txt .
914
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " Podcast Generator" ,
3+ "short_name" : " PodcastGen" ,
4+ "description" : " Generate podcasts from text scripts using AI." ,
5+ "start_url" : " /" ,
6+ "display" : " standalone" ,
7+ "background_color" : " #121212" ,
8+ "theme_color" : " #1e1e1e" ,
9+ "icons" : [
10+ {
11+ "src" : " /assets/podcast.png" ,
12+ "sizes" : " 192x192" ,
13+ "type" : " image/png"
14+ },
15+ {
16+ "src" : " /assets/podcast.png" ,
17+ "sizes" : " 512x512" ,
18+ "type" : " image/png"
19+ }
20+ ]
21+ }
Original file line number Diff line number Diff line change 1+ const CACHE_NAME = 'podcast-generator-cache-v1' ;
2+ const urlsToCache = [
3+ '/' ,
4+ '/assets/podcast.png' ,
5+ '/static/manifest.webmanifest'
6+ ] ;
7+
8+ // Install the service worker and cache the app shell
9+ self . addEventListener ( 'install' , event => {
10+ event . waitUntil (
11+ caches . open ( CACHE_NAME )
12+ . then ( cache => {
13+ console . log ( 'Opened cache' ) ;
14+ return cache . addAll ( urlsToCache ) ;
15+ } )
16+ ) ;
17+ } ) ;
18+
19+ // Serve cached content when offline
20+ self . addEventListener ( 'fetch' , event => {
21+ // We only want to cache GET requests.
22+ if ( event . request . method !== 'GET' ) {
23+ return ;
24+ }
25+
26+ event . respondWith (
27+ caches . match ( event . request )
28+ . then ( response => {
29+ // Cache hit - return response
30+ return response || fetch ( event . request ) ;
31+ } )
32+ ) ;
33+ } ) ;
Original file line number Diff line number Diff line change 55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > Podcast Generator</ title >
77 < link rel ="icon " href ="/assets/podcast.png " type ="image/png ">
8+ < link rel ="manifest " href ="/static/manifest.webmanifest ">
9+ < meta name ="theme-color " content ="#1e1e1e ">
10+ <!-- iOS support -->
11+ < link rel ="apple-touch-icon " href ="/assets/podcast.png ">
812 < style >
913 : root {
1014 --bg-color : # f4f4f9 ;
@@ -682,6 +686,17 @@ <h3>Asset Credits</h3>
682686 generateDemoConfirmBtn . textContent = 'Generate' ;
683687 }
684688 }
689+
690+ // --- PWA Service Worker Registration ---
691+ if ( 'serviceWorker' in navigator ) {
692+ window . addEventListener ( 'load' , ( ) => {
693+ navigator . serviceWorker . register ( '/static/sw.js' ) . then ( registration => {
694+ console . log ( 'ServiceWorker registration successful with scope: ' , registration . scope ) ;
695+ } , err => {
696+ console . log ( 'ServiceWorker registration failed: ' , err ) ;
697+ } ) ;
698+ } ) ;
699+ }
685700 } ) ;
686701 </ script >
687702</ body >
You can’t perform that action at this time.
0 commit comments