Fixes: 
- Default Nuxt port changed to 3000 (thanks to @yurgeman).
- Cleanup old images effectively.
- More attempts on container startups (3->6).
- Always clean up server logs on restart/redeploy.
This commit is contained in:
Andras Bacsai
2021-04-26 11:45:04 +02:00
committed by GitHub
parent e16b7d65d4
commit b416e3ab3e
8 changed files with 22 additions and 25 deletions

View File

@@ -2,9 +2,12 @@ const { docker } = require('../../docker')
const { execShellAsync } = require('../../common')
const Deployment = require('../../../models/Deployment')
async function purgeImagesContainers () {
async function purgeImagesContainers (configuration) {
const { name, tag } = configuration.build.container
await execShellAsync('docker container prune -f')
await execShellAsync('docker image prune -f --filter=label!=coolify-reserve=true')
const IDsToDelete = (await execShellAsync(`docker images ls --filter=reference='${name}' --filter=before='${name}:${tag}' --format '{{json .ID }}'`)).trim().replace(/"/g, '').split('\n')
if (IDsToDelete.length !== 0) for (const id of IDsToDelete) await execShellAsync(`docker rmi -f ${id}`)
await execShellAsync('docker image prune -f')
}
async function cleanupStuckedDeploymentsInDB () {