@@ -46,16 +46,28 @@ Vagrant.configure("2") do |config|
46
46
# argument is a set of non-required options.
47
47
# config.vm.synced_folder "../data", "/vagrant_data"
48
48
49
+ # config.vm.synced_folder "./", "/home/vagrant/app", type: "rsync", rsync__auto: true, rsync__exclude: ["./*venv*", "./vscode", "./.github", "./assets", "__pycache__", "./*.md"]
50
+
51
+
49
52
# Provider-specific configuration so you can fine-tune various
50
53
# backing providers for Vagrant. These expose provider-specific options.
51
- # Example for VirtualBox:
52
- #
53
- config . vm . provider "vmware_desktop" do |vb |
54
+ # VMware Workstation/Fusion provider
55
+ config . vm . provider "vmware_desktop" do |vmware |
54
56
# Display the GUI when booting the machine
55
- vb . gui = true
57
+ vmware . gui = true
56
58
57
- # Customize the amount of memory on the VM:
59
+ # Customize the amount of memory and CPU on the VM
60
+ vmware . vmx [ "memsize" ] = "4096"
61
+ vmware . vmx [ "numvcpus" ] = "2"
62
+ end
63
+ # Virtualbox provider
64
+ config . vm . provider "virtualbox" do |vb |
65
+ # Display the GUI when booting the machine
66
+ vb . gui = true
67
+
68
+ # Customize the amount of memory and CPU on the VM
58
69
vb . memory = "4096"
70
+ vb . cpus = 2
59
71
end
60
72
#
61
73
# View the documentation for the provider you are using for more
@@ -64,31 +76,7 @@ Vagrant.configure("2") do |config|
64
76
# Enable provisioning with a shell script. Additional provisioners such as
65
77
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
66
78
# documentation for more information about their specific syntax and use.
67
- config . vm . provision "shell" , inline : <<-SHELL
68
- # Update and Install requirements
69
- apt-get update
70
- apt-get install -y python3-pip python3-dev python3-venv python3-setuptools nginx redis supervisor git
71
-
72
- # Configure Nginx
73
- unlink /etc/nginx/sites-enabled/default
74
- cp /home/vagrant/app/nginx.conf /etc/nginx/sites-enabled/
75
-
76
- # Clone the Flask application from GitHub to /home/vagrant/app
77
- git clone -b feature/vagrant https://github.com/Tes3awy/PSIRT.git /home/vagrant/app
78
-
79
- # Install requirements, Gunicorn, and Flask-Limiter
80
- python3 -m venv /home/vagrant/app/venv
81
- source /home/vagrant/app/venv/bin/activate
82
- python3 -m pip install --no-cache-dir -r /home/vagrant/app/requirements.txt gunicorn Flask-Limiter[redis]==3.3.0
83
-
84
- # Start the application
85
- nginx -s reload
86
-
87
- # Configure supervisor
88
- mkdir /var/log/psiapp
89
- mkdir /etc/supervisor/conf.d/psiapp
90
- cp /home/vagrant/app/supervisor.conf /etc/supervisor/conf.d/psiapp
91
- sudo supervisorctl reload
92
-
93
- SHELL
79
+ config . vm . synced_folder "." , "/home/vagrant/app" , type : "rsync" ,
80
+ rsync__exclude : [ ".git" , "*env" , "__pycache__" , "*/__pycache__" , "^[Dd]ocker*" , ".git*" "*.md" , "security.txt" ]
81
+ config . vm . provision "shell" , keep_color : true , path : "setup.sh"
94
82
end
0 commit comments