sudo apt update
git clone <repository-url>
cd <repository-folder>
sudo apt install python3.10
sudo apt install python3-pip
pip install -r requirements.txt
python3
from app import db
db.create_all()
curl -L http://xrl.us/installperlnix | bash
sudo apt-get install libgd-dev
sudo apt-get install libgd-perl # for GD
Run CPAN to install additional modules:
cpan
install GD
install Math::Random
install Term::ProgressBar
install GD::SVG
install Statistics::Basic
mkdir terrains
mkdir imgs
sudo apt install gunicorn3
sudo apt install nginx
Edit the Nginx configuration file:
sudo nano /etc/nginx/sites-enabled/flask_app
Add the following code:
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
sudo unlink /etc/nginx/sites-enabled/default
sudo nginx -t
sudo nginx -s reload
sudo ufw allow 8000
# In config.py
SECRET_KEY = 'your-new-secret-key'
Start the application with Gunicorn. Adjust the number of workers as needed:
gunicorn3 --workers=3 app:app
To run it 24/7, add the --daemon flag:
gunicorn3 --workers=3 --daemon app:app