Skip to content

Commit

Permalink
changed flask run command
Browse files Browse the repository at this point in the history
  • Loading branch information
proquickly committed Nov 19, 2024
1 parent dc037ba commit faf81be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ resource "aws_instance" "py_server" {
#!/bin/bash
sudo apt-get update
sudo apt-get install -y python3 python3-pip
pip3 install flask
pip3 install flask requests
mkdir -p /home/ubuntu/app
cat <<EOL > /home/ubuntu/app/app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello from Python!"
app.run(host='0.0.0.0', port=5000)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
EOL
cd /home/ubuntu/app
nohup python3 /home/ubuntu/app/app.py &
nohup python3 app.py &
EOF

tags = {
Expand Down

0 comments on commit faf81be

Please sign in to comment.