UNPKG

498 BJavaScriptView Raw
1var fs = require('fs');
2var path = require('path');
3var _ = require('lodash');
4var exists = require('is-there');
5
6
7module.exports = {
8 name: 'python',
9 detect: function(dir) {
10 if (exists.sync(path.resolve(dir, 'requirements.txt'))) return true;
11 },
12 getDockerfile: function(dir) {
13 var templatePath = path.resolve(__dirname, 'Dockerfile.t');
14 var template = fs.readFileSync(templatePath, { encoding: 'utf8' });
15 var compiled = _.template(template);
16 return compiled({});
17 }
18};