@@ -10,11 +10,11 @@ const shouldOpenDevTools = process.env.AKOFLOW_OPEN_DEVTOOLS === '1';
1010
1111function logMain ( message , details ) {
1212 if ( details !== undefined ) {
13- console . log ( `[AkoFlow ] ${ message } ` , details ) ;
13+ console . log ( `[AkôFlow ] ${ message } ` , details ) ;
1414 return ;
1515 }
1616
17- console . log ( `[AkoFlow ] ${ message } ` ) ;
17+ console . log ( `[AkôFlow ] ${ message } ` ) ;
1818}
1919
2020async function checkDockerStatus ( ) {
@@ -28,7 +28,7 @@ async function checkDockerStatus() {
2828 return {
2929 status : 'missing' ,
3030 title : 'Docker not found' ,
31- message : 'Install Docker Desktop to continue using AkoFlow locally.' ,
31+ message : 'Install Docker Desktop to continue using AkôFlow locally.' ,
3232 error : error ?. message || 'Docker CLI is unavailable.' ,
3333 actionLabel : 'Install Docker Desktop' ,
3434 actionUrl : 'https://www.docker.com/products/docker-desktop/' ,
@@ -101,7 +101,7 @@ function getSystemInfo() {
101101 const platformLabel = platformLabels [ platform ] ?? platform ;
102102 const architectureLabel = architectureLabels [ architecture ] ?? architecture . toUpperCase ( ) ;
103103
104- logs . push ( `[AkoFlow ] Collecting system information: ${ platformLabel } / ${ architectureLabel } ` ) ;
104+ logs . push ( `[AkôFlow ] Collecting system information: ${ platformLabel } / ${ architectureLabel } ` ) ;
105105 logMain ( 'Collecting system information' , `${ platformLabel } / ${ architectureLabel } ` ) ;
106106
107107 return {
@@ -171,7 +171,7 @@ function createWindow() {
171171 minWidth : 1100 ,
172172 minHeight : 760 ,
173173 backgroundColor : '#07111f' ,
174- title : 'AkoFlow Desktop' ,
174+ title : 'AkôFlow Desktop' ,
175175 icon : path . join ( __dirname , '..' , 'assets' , iconFile ) ,
176176 webPreferences : {
177177 preload : path . join ( __dirname , 'preload.js' ) ,
@@ -209,10 +209,9 @@ function createWindow() {
209209}
210210
211211/* ─────────────────────────────────────────────────────────────
212- AkoFlow container management
212+ AkôFlow container management
213213───────────────────────────────────────────────────────────── */
214214const AKOFLOW_CONTAINER = 'akoflow-local' ;
215- const AKOFLOW_VOLUME = 'akoflow-local-data' ;
216215const AKOFLOW_IMAGE = 'akoflow/akoflow' ;
217216const AKOFLOW_PORT = 7777 ;
218217
@@ -270,21 +269,35 @@ ipcMain.handle('akoflow:pull-image', async (event) => {
270269
271270ipcMain . handle ( 'akoflow:start-container' , async ( ) => {
272271 logMain ( 'Starting container' , AKOFLOW_CONTAINER ) ;
273- // Remove any leftover container (stopped / exited)
272+
273+ // Check if a container already exists (may be stopped / exited)
274274 try {
275- await execFileAsync ( 'docker' , [ 'rm' , '-f' , AKOFLOW_CONTAINER ] , { timeout : 8000 } ) ;
276- } catch { /* nothing to remove */ }
275+ const { stdout } = await execFileAsync ( 'docker' , [
276+ 'inspect' , AKOFLOW_CONTAINER , '--format' , '{{.State.Status}}' ,
277+ ] , { timeout : 5000 } ) ;
278+
279+ const status = stdout . trim ( ) ;
280+ logMain ( 'Existing container found' , status ) ;
281+
282+ if ( status === 'running' ) {
283+ logMain ( 'Container already running' ) ;
284+ return { ok : true } ;
285+ }
286+
287+ // Stopped / exited — restart it (preserves filesystem & data)
288+ await execFileAsync ( 'docker' , [ 'start' , AKOFLOW_CONTAINER ] , { timeout : 15000 } ) ;
289+ logMain ( 'Container restarted' ) ;
290+ return { ok : true } ;
291+ } catch { /* container does not exist — create it fresh */ }
277292
278293 await execFileAsync ( 'docker' , [
279294 'run' , '-d' ,
280- '--rm' ,
281295 '--name' , AKOFLOW_CONTAINER ,
282296 '-p' , `${ AKOFLOW_PORT } :80` ,
283- '-v' , `${ AKOFLOW_VOLUME } :/data` ,
284297 AKOFLOW_IMAGE ,
285298 ] , { timeout : 15000 } ) ;
286299
287- logMain ( 'Container started' ) ;
300+ logMain ( 'Container created and started' ) ;
288301 return { ok : true } ;
289302} ) ;
290303
@@ -347,13 +360,13 @@ app.on('window-all-closed', () => {
347360 }
348361} ) ;
349362
350- // Stop the AkoFlow container gracefully when the app quits
363+ // Stop the AkôFlow container gracefully when the app quits
351364let isQuitting = false ;
352365app . on ( 'will-quit' , ( event ) => {
353366 if ( isQuitting ) return ;
354367 event . preventDefault ( ) ;
355368 isQuitting = true ;
356- logMain ( 'App quitting — stopping AkoFlow container' ) ;
369+ logMain ( 'App quitting — stopping AkôFlow container' ) ;
357370 Promise . race ( [
358371 stopAkoflowContainer ( ) ,
359372 new Promise ( ( resolve ) => setTimeout ( resolve , 6000 ) ) ,
0 commit comments