Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Timo Heikkilä
PET-rating
Commits
f7114606
Commit
f7114606
authored
Apr 15, 2021
by
Ossi Laine
Browse files
Update README
parent
f4cc1322
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
f7114606
...
...
@@ -2,14 +2,21 @@
### Prerequisites
Flask app with MariaDB
Flask app with
MySql/
MariaDB
Check requirements.txt
### Installing
### Deployment
There are multiple deployment options, but one working solution is:
nginx + gunicorn (with gevent worker)
Working directory: /srv/rating
#### Installing prequisites
Install python packages with pip and preferably in virtual environment:
```
yy
```
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
...
...
@@ -19,13 +26,10 @@ Create user 'rating' and grant access to database 'rating_db'.
Create necessary tables by running the initialization script:
```
mysql -u rating -p -D rating_db < create_rating_db.sql
mysql -u rating -p -D rating_db <
db/
create_rating_db.sql
```
### Deployment
There are multiple deployment options, but one working solution is:
nginx + gunicorn (with gevent worker)
#### Setting startup script
Create systemd startup script in '/etc/systemd/system/gunicorn.service'
...
...
@@ -52,15 +56,33 @@ service gunicorn enable
service gunicorn start
```
### Logs
###
#
Logs
Error logs are saved to application folder (/srv/rating/logs/)
Optionally with journalctl:
journalctl -u gunicorn.service
### Restart server after updates
###
#
Restart server after updates
```
service gunicorn restart
```
### Deployment with docker
Install docker and docker-compose
Go to deploy folder. Build containers and run them with:
```
docker-compose -f docker-compose.yml up -d --build
```
This will create persistent database 'rating_db' to deploy/dbdata with user 'rating'.
Application should be up and running in 'localhost'.
### Project contact details
-
osmala@utu.fi
-
timo.t.heikkila@utu.fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment