From e0eaac95660db92399b8ddf1e1349f82bdf9f907 Mon Sep 17 00:00:00 2001 From: Andy Miles Date: Sun, 8 Dec 2024 06:32:50 -0800 Subject: [PATCH] redoing userdata --- terraform/main.tf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index f25c8d8..d95a5c2 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -64,21 +64,24 @@ resource "aws_instance" "py_server" { key_name = aws_key_pair.deployer.key_name user_data = <<-EOF #!/bin/bash + PROJ=tfgha + POETRY=/usr/local/bin WORKDIR=/home/ubuntu + sudo apt-get update sudo apt-get install -y python3 python3-pip git curl - curl -sSL https://install.python-poetry.org | python3 - - # python3 -m pip install -U poetry + #curl -sSL https://install.python-poetry.org | python3 - + python3 -m pip install -U poetry cd $WORKDIR git clone https://github.com/proquickly/$PROJ.git cd $WORKDIR/$PROJ export PATH="$HOME/.local/bin:$PATH" - poetry install + $POETRY/poetry install cd $WORKDIR/$PROJ/src/$PROJ - nohup poetry run python app.py & + nohup $POETRY/poetry run python app.py & EOF tags = {