
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!
27 lines
951 B
JavaScript
27 lines
951 B
JavaScript
const fs = require('fs').promises
|
|
const { streamEvents, docker } = require('../../libs/docker')
|
|
// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',
|
|
const publishPHPDocker = (configuration) => {
|
|
return [
|
|
'FROM php:apache',
|
|
'RUN a2enmod rewrite',
|
|
'WORKDIR /usr/src/app',
|
|
`COPY .${configuration.build.directory} /var/www/html`,
|
|
'EXPOSE 80',
|
|
' CMD ["apache2-foreground"]'
|
|
].join('\n')
|
|
}
|
|
|
|
module.exports = async function (configuration) {
|
|
try {
|
|
await fs.writeFile(`${configuration.general.workdir}/Dockerfile`, publishPHPDocker(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' }
|
|
}
|
|
}
|