File tree Expand file tree Collapse file tree
apps/dokploy/server/api/routers
packages/server/src/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {
1212 DEFAULT_UPDATE_DATA ,
1313 execAsync ,
1414 findServerById ,
15- getDokployImage ,
1615 getDokployImageTag ,
1716 getLogCleanupStatus ,
1817 getUpdateData ,
@@ -22,7 +21,6 @@ import {
2221 paths ,
2322 prepareEnvironmentVariables ,
2423 processLogs ,
25- pullLatestRelease ,
2624 readConfig ,
2725 readConfigInPath ,
2826 readDirectory ,
@@ -406,18 +404,17 @@ export const settingsRouter = createTRPCRouter({
406404 return true ;
407405 }
408406
409- await pullLatestRelease ( ) ;
410-
411- // This causes restart of dokploy, thus it will not finish executing properly, so don't await it
412- // Status after restart is checked via frontend /api/health endpoint
413- void spawnAsync ( "docker" , [
414- "service" ,
415- "update" ,
416- "--force" ,
417- "--image" ,
418- getDokployImage ( ) ,
419- "dokploy" ,
420- ] ) ;
407+ const data = await getUpdateData ( packageInfo . version ) ;
408+ if ( data . updateAvailable ) {
409+ void spawnAsync ( "docker" , [
410+ "service" ,
411+ "update" ,
412+ "--force" ,
413+ "--image" ,
414+ `dokploy/dokploy:${ data . latestVersion } ` ,
415+ "dokploy" ,
416+ ] ) ;
417+ }
421418
422419 return true ;
423420 } ) ,
Original file line number Diff line number Diff line change 11import { readdirSync } from "node:fs" ;
22import { join } from "node:path" ;
3- import { docker } from "@dokploy/server/constants" ;
43import {
54 execAsync ,
65 execAsyncRemote ,
@@ -26,19 +25,6 @@ export const getDokployImageTag = () => {
2625 return process . env . RELEASE_TAG || "latest" ;
2726} ;
2827
29- export const getDokployImage = ( ) => {
30- return `dokploy/dokploy:${ getDokployImageTag ( ) } ` ;
31- } ;
32-
33- export const pullLatestRelease = async ( ) => {
34- const stream = await docker . pull ( getDokployImage ( ) ) ;
35- await new Promise ( ( resolve , reject ) => {
36- docker . modem . followProgress ( stream , ( err , res ) =>
37- err ? reject ( err ) : resolve ( res ) ,
38- ) ;
39- } ) ;
40- } ;
41-
4228/** Returns Dokploy docker service image digest */
4329export const getServiceImageDigest = async ( ) => {
4430 const { stdout } = await execAsync (
You can’t perform that action at this time.
0 commit comments