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

@@ -85,10 +85,8 @@ mongoose.connection.once('open', async function () {
console.log('Coolify API is up and running in development.')
}
try {
const { main } = (await axios.get('https://get.coollabs.io/version.json')).data.coolify
if (main.clearServerLogs) {
await mongoose.connection.db.dropCollection('logs-servers')
}
// Always cleanup server logs
await mongoose.connection.db.dropCollection('logs-servers')
} catch (error) {
// Could not cleanup logs-servers collection
}
@@ -102,16 +100,11 @@ mongoose.connection.once('open', async function () {
// Doing because I do not want to prune these images. Prune skips coolify-reserve labeled images.
const basicImages = ['nginx:stable-alpine', 'node:lts', 'ubuntu:20.04', 'php:apache', 'rust:latest']
for (const image of basicImages) {
await execShellAsync(`echo "FROM ${image}" | docker build --label coolify-reserve=true -t ${image} -`)
// await execShellAsync(`echo "FROM ${image}" | docker build --label coolify-reserve=true -t ${image} -`)
await execShellAsync(`docker pull ${image}`)
}
} catch (error) {
console.log('Could not pull some basic images from Docker Hub.')
console.log(error)
}
try {
await purgeImagesContainers()
} catch (error) {
console.log('Could not purge containers/images.')
console.log(error)
}
})