Commit af53d479 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

FEAT: improve Vagrantfile (localhost IP, final msg)

- allow only localhost for host IP
- add message to show after vagrant up
parent 6f0f7c87
......@@ -10,17 +10,16 @@ SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "ds" do |ds|
config.vm.synced_folder "../demarches-simplifiees.fr", "/shared_dev"
# config.vm.network "public_network", :bridge => "eno1"
ds.vm.provider "virtualbox" do |vb|
vb.name = "DemarchesSimplifiees "
vb.memory = "4096"
vb.cpus = "4"
end
ds.vm.box = "ubuntu/bionic64"
ds.vm.network "forwarded_port", id: 'WebServer', guest: 3000, host: 3000, auto_correct: true
ds.vm.network "forwarded_port", id: 'PostgreSQL', guest: 5432, host: 5439, auto_correct: true
ds.vm.network "forwarded_port", id: 'MailHogGUI', guest: 8025, host: 8025, auto_correct: true
ds.vm.network "forwarded_port", id: 'PumaServer', guest: 3000, host: 3000, auto_correct: true, host_ip: "127.0.0.1"
ds.vm.network "forwarded_port", id: 'PostgreSQL', guest: 5432, host: 5439, auto_correct: true, host_ip: "127.0.0.1"
# ds.vm.network "forwarded_port", id: 'WebProxy', guest: 80, host: 8080, auto_correct: true, host_ip: "127.0.0.1"
# ds.vm.network "forwarded_port", id: 'MailHogGUI', guest: 8025, host: 8025, auto_correct: true, host_ip: "127.0.0.1"
ds.vm.hostname = "ds.example.org"
ds.vm.provision "shell", inline: $script_bionic
ds.vm.provision "puppet" do |ds1|
......@@ -29,5 +28,44 @@ Vagrant.configure("2") do |config|
# ds1.options = "--verbose --debug"
end
end
# Message to show after vagrant up
###############################################################################################
###############################################################################################
config.vm.post_up_message = <<-MESSAGE
------------------------------------------------
/!\\ Created for test purposes only,
not to be used in production
------------------------------------------------
# To see application log:
vagrant ssh -c 'tail -f demarches-simplifiees.fr/log/development.log'
# To see .env file
vagrant ssh -c 'cd demarches-simplifiees.fr; cat .env'
# To see application configuration (environment name, schema version, Ruby/Rails version)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/rake about'
# Update dependencies and database (useful if you have updated the DS repository)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/update'
# Finalize installation (1)
vagrant ssh -c 'cd demarches-simplifiees.fr; bin/setup'
# Start server to be able to restart it quickly (use Ctrl-C to stop it)
vagrant ssh -c 'cd demarches-simplifiees.fr; RAILS_QUEUE_ADAPTER=delayed_job; bin/rails server --binding=0.0.0.0'
------------------------------------------------
Use 'vagrant port' command line to see port mapping.
Default : 3000 (guest) --> 3000 (host) Puma server port
------------------------------------------------
URL webmail ... http://localhost:3000/letter_opener (default)
URL webapp .... http://localhost:3000 (default) ---> fisrt run: see (1)
------------------------------------------------
MESSAGE
###############################################################################################
###############################################################################################
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment