#!/usr/bin/env node /** * Bud file for site. * Executing this file renders nginx virtual host configurations. * * Generated by {{generator}} on {{today}}, * from a template provided by {{pkg.name}}. * * @see https://github.com/coz-repo/coz */ "use strict"; const apemanBudNginx = require('apeman-bud-nginx'), apeman = require('apeman'), path = require('path'), configuration = require('../../../Apemanfile'); const $pkg = configuration.$pkg, $ctx = configuration.$ctx, env = $ctx.env, nginxMountDir = $ctx.nginxMountDir; let domain = env('domain'), port = env('port'), public_ = env('public'), error = env('error'); module.exports = Object.keys(domain).map((key) => { return apemanBudNginx({ /** * Domain of the virtual host. */ domain: domain[key], /** * Application name. */ name: key, /** * Ports to proxy. */ port: port[key], /** * Path of public directory on the container. */ public: path.resolve(nginxMountDir, public_[key]), /** * Path of error files directory on the container. */ error: path.resolve(nginxMountDir, error[key]), /** * Host name of destination server. * Use the node container hostname, which is written in /etc/hosts on the container by Docker network. */ server: apeman.dply.nameDply('node', $pkg) }); }); {{{read _render}}}