-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
38 lines (29 loc) · 1.23 KB
/
Vagrantfile
File metadata and controls
38 lines (29 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-get update
# Install pyenv prerequisites
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# Install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.profile
source ~/.profile
pyenv install 3.8.5
pyenv global 3.8.5
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
SHELL
config.trigger.after :up do |trigger|
trigger.name = "Launching App"
trigger.info = "Running TODO app setup script"
trigger.run_remote ={privileged: false, inline: "
cd /vagrant
poetry install
nohup poetry run flask run > app.log 2>&1 &
"}
end
config.vm.network "forwarded_port", guest: 5000, host: 5000
end