K
K
Kit Scribe2020-11-23 16:56:08
linux
Kit Scribe, 2020-11-23 16:56:08

How to run a Flask application as a service on linux?

I made a config file

[Unit]
Description="flask app"
After=network.target

[Service]
User=kitscribe
WorkingDirectory=/home/kitscribe/Documents/projects/
Environment=/home/kitscribe/Documents/projects/venv/bin/
ExecStart=/home/kitscribe/Documents/projects/venv/bin/flask run /home/kitscribe/Documents/projects/todo/app.py
Restart=on-failure

[Install]
WantedBy=multi-user.target


Restarted the daemon, enabled and started the created service. At first it showed the status "loaded", but then changed to "failed with result exit-code". I believe that I incorrectly set the paths in the config, but I do not know how to solve this problem. I ask for help or literature on the topic. Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Vasilyev, 2020-11-23
@kitscribe

Here is a detailed manual, go through the steps:
https://www.digitalocean.com/community/tutorials/h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question