Last active
February 28, 2022 13:02
-
-
Save bhubr/103688c95a980338bb6edd21018f5692 to your computer and use it in GitHub Desktop.
ecosystem.config.js sample for TypeScript Node.js server (without deploy)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ecosystem.config.js | |
// https://stackoverflow.com/q/60581617 | |
module.exports = { | |
apps : [{ | |
name: 'node-album-api', | |
// On doit passer directement le chemin vers l'"exécutable" ts-node | |
script: './node_modules/.bin/ts-node', | |
// Paramètres recommandés pour le fonctionnement en production | |
// (Diminue l'empreinte mémoire) | |
args: '--transpile-only src/index.ts', | |
}], | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# Define VMs with static private IP addresses, vcpu, memory and vagrant-box. | |
boxes = [ | |
{ | |
:box => "debian/bullseye64", | |
:name => "managed-host1", | |
:ram => 1024, | |
:vcpu => 1, | |
:ip => "192.168.56.10", | |
:ports => [5000] | |
}, | |
{ | |
:box => "debian/bullseye64", | |
:name => "ansible-host", | |
:ram => 2048, | |
:vcpu => 1, | |
:ip => "192.168.56.1", | |
:ports => [] | |
} | |
] | |
# Provision each of the VMs. | |
boxes.each do |opts| | |
config.vm.define opts[:name] do |config| | |
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true | |
config.ssh.insert_key = false | |
config.vm.box = opts[:box] | |
config.vm.hostname = opts[:name] | |
config.vm.provider :virtualbox do |v| | |
v.memory = opts[:ram] | |
v.cpus = opts[:vcpu] | |
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
end | |
config.vm.network :private_network, ip: opts[:ip] | |
opts[:ports].each do |port| | |
config.vm.network "forwarded_port", guest: port, host: port | |
end | |
config.vm.synced_folder "shared/", "/shared" | |
# config.vm.provision :file do |file| | |
# file.source = './keys/vagrant' | |
# file.destination = '/tmp/vagrant' | |
# end | |
# config.vm.provision :file do |file| | |
# file.source = './inventory-test.yaml' | |
# file.destination = '/home/vagrant/inventory-test.yaml' | |
# end | |
# config.vm.provision :shell, path: "bootstrap-node.sh" | |
# config.vm.provision :ansible do |ansible| | |
# ansible.verbose = "v" | |
# ansible.playbook = "playbook.yml" | |
# end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment