1 | var fs = require('fs');
|
2 | var path = require('path');
|
3 | var _ = require('lodash');
|
4 | var exists = require('is-there');
|
5 |
|
6 |
|
7 | module.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 | };
|