Vagrantfile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # All Vagrant configuration is done below. The "2" in Vagrant.configure
  4. # configures the configuration version (we support older styles for
  5. # backwards compatibility). Please don't change it unless you know what
  6. # you're doing.
  7. Vagrant.configure("2") do |config|
  8. # The most common configuration options are documented and commented below.
  9. # For a complete reference, please see the online documentation at
  10. # https://docs.vagrantup.com.
  11. # Every Vagrant development environment requires a box. You can search for
  12. # boxes at https://vagrantcloud.com/search.
  13. config.vm.box = "archlinux/archlinux"
  14. config.vm.box_version = "20241001.267073"
  15. # Disable automatic box update checking. If you disable this, then
  16. # boxes will only be checked for updates when the user runs
  17. # `vagrant box outdated`. This is not recommended.
  18. # config.vm.box_check_update = false
  19. # Create a forwarded port mapping which allows access to a specific port
  20. # within the machine from a port on the host machine. In the example below,
  21. # accessing "localhost:8080" will access port 80 on the guest machine.
  22. # NOTE: This will enable public access to the opened port
  23. config.vm.network "forwarded_port", guest: 8000, host: 8000
  24. config.vm.network "forwarded_port", guest: 3000, host: 3000
  25. config.vm.network "forwarded_port", id: "ssh", guest: 22, host: 10022
  26. # Create a forwarded port mapping which allows access to a specific port
  27. # within the machine from a port on the host machine and only allow access
  28. # via 127.0.0.1 to disable public access
  29. # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  30. # Create a private network, which allows host-only access to the machine
  31. # using a specific IP.
  32. # config.vm.network "private_network", ip: "192.168.33.10"
  33. # Create a public network, which generally matched to bridged network.
  34. # Bridged networks make the machine appear as another physical device on
  35. # your network.
  36. config.vm.network "public_network"
  37. # Share an additional folder to the guest VM. The first argument is
  38. # the path on the host to the actual folder. The second argument is
  39. # the path on the guest to mount the folder. And the optional third
  40. # argument is a set of non-required options.
  41. config.vm.synced_folder "./mnt", "/mnt"
  42. # Disable the default share of the current code directory. Doing this
  43. # provides improved isolation between the vagrant box and your host
  44. # by making sure your Vagrantfile isn't accessible to the vagrant box.
  45. # If you use this you may want to enable additional shared subfolders as
  46. # shown above.
  47. # config.vm.synced_folder ".", "/vagrant", disabled: true
  48. # Provider-specific configuration so you can fine-tune various
  49. # backing providers for Vagrant. These expose provider-specific options.
  50. # Example for VirtualBox:
  51. #
  52. config.vm.provider "virtualbox" do |vb|
  53. vb.name = "spring"
  54. # # Display the VirtualBox GUI when booting the machine
  55. # vb.gui = true
  56. #
  57. # Customize the amount of memory on the VM:
  58. vb.memory = "4096"
  59. end
  60. #
  61. # View the documentation for the provider you are using for more
  62. # information on available options.
  63. config.ssh.insert_key = false
  64. config.ssh.password = "123456"
  65. # Enable provisioning with a shell script. Additional provisioners such as
  66. # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
  67. # documentation for more information about their specific syntax and use.
  68. config.vm.provision "shell", inline: <<-SHELL
  69. pacman-key --init
  70. pacman -Sy --noconfirm archlinux-keyring
  71. pacman-key --populate
  72. pacman -Syu --noconfirm
  73. pacman -S --needed --noconfirm base-devel bzip2 bzip3 p7zip unarchiver vim git cmake wget zsh man-db man-pages \
  74. pwgen sshpass openssl openssh rsync zip unzip tree tmux asciidoc doxygen cpio net-tools bind-tools \
  75. imagemagick ffmpeg xorg-font-util \
  76. ttf-dejavu wqy-bitmapfont wqy-microhei wqy-zenhei \
  77. composer xdebug php-fpm php-pgsql php-sqlite php-redis php-mongodb php-imagick php-gd php-intl php-enchant php-snmp php-tidy php-xsl php-sodium php-odbc php-pspell \
  78. hspell nuspell libvoikko hunspell hunspell-en_us \
  79. nodejs npm yarn \
  80. postgresql rabbitmq redis
  81. pacman -Scc --noconfirm
  82. echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
  83. systemctl enable postgresql
  84. systemctl eanble redis
  85. systemctl enable rabbitmq
  86. su -c vagrant -l mkdir -p ~/downloads ~/build ~/local ~/tmp
  87. su -c vagrant -l git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
  88. su -c vagrant -l cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  89. su -c vagrant -l echo 'export LANG=en_US.UTF-8' >> ~/.zshrc
  90. su -c vagrant -l echo 'export LC_ALL=en_US.UTF-8' >> ~/.zshrc
  91. su -c vagrant -l echo 'export EDITOR=vim' >> ~/.zshrc
  92. su -c vagrant -l git config --global core.quotepath false
  93. su -c vagrant -l git config --global http.version HTTP/1.1
  94. su -c vagrant -l git config --global pull.rebase false
  95. su -c vagrant -l echo 'set-option -g history-limit 102400' > ~/.tmux.conf
  96. su -c vagrant -l echo 'set-option -g default-shell "/bin/zsh"' >> ~/.tmux.conf
  97. chsh -s /bin/zsh vagrant
  98. SHELL
  99. end