
Features:
- Rust support 🦀 (Thanks to @pepoviola)
- Add a default rewrite rule to PHP apps (to index.php)
- Able to control upgrades in a straightforward way
Fixes:
- Improved upgrade scripts
- Simplified prechecks before deployment
- Fixed path deployments
- Fixed already defined apps redirections
- Better error handling - still needs a lot of improvement here!
28 lines
925 B
JavaScript
28 lines
925 B
JavaScript
const fs = require('fs').promises
|
|
const { streamEvents, docker } = require('../libs/docker')
|
|
const buildImageNodeDocker = (configuration) => {
|
|
return [
|
|
'FROM node:lts',
|
|
'WORKDIR /usr/src/app',
|
|
`COPY ${configuration.build.directory} ./`,
|
|
configuration.build.command.installation && `RUN ${configuration.build.command.installation}`,
|
|
`RUN ${configuration.build.command.build}`
|
|
].join('\n')
|
|
}
|
|
async function buildImage (configuration) {
|
|
try {
|
|
await fs.writeFile(`${configuration.general.workdir}/Dockerfile`, buildImageNodeDocker(configuration))
|
|
const stream = await docker.engine.buildImage(
|
|
{ src: ['.'], context: configuration.general.workdir },
|
|
{ t: `${configuration.build.container.name}:${configuration.build.container.tag}` }
|
|
)
|
|
await streamEvents(stream, configuration)
|
|
} catch (error) {
|
|
throw { error, type: 'server' }
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
buildImage
|
|
}
|