diff options
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | libretranslate.service | 2 | ||||
-rwxr-xr-x | setup.sh | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -4,6 +4,7 @@ Run LibreTranslate on Ubuntu 20.04. Uses [LibreTranslate WSGI](https://community.libretranslate.com/t/is-wsgi-currently-supported/24/3) with [Gunicorn and Nginx](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04). ``` + # Add argosopentech user useradd argosopentech mkdir /home/argosopentech @@ -15,6 +16,13 @@ chsh -s /bin/bash argosopentech usermod -aG sudo argosopentech su argosopentech +# Add swap space (optional) +sudo fallocate -l 10G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +sudo swapon --show + # Download and run LibreTranslate-init git clone https://github.com/argosopentech/LibreTranslate-init.git ~/LibreTranslate-init ~/LibreTranslate-init/setup.sh diff --git a/libretranslate.service b/libretranslate.service index 9b60f87..ac6a081 100644 --- a/libretranslate.service +++ b/libretranslate.service @@ -6,7 +6,7 @@ After=network.target User=argosopentech Group=www-data WorkingDirectory=/home/argosopentech/LibreTranslate -Environment="PATH=/home/argosopentech/LibreTranslate/env/bin +Environment="PATH=/home/argosopentech/LibreTranslate/env/bin" ExecStart=/home/argosopentech/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app [Install] @@ -27,7 +27,7 @@ libretranslate pip install gunicorn # Setup systemd -sudo cp libretranslate.service /etc/systemd/system/ +sudo cp ~/LibreTranslate-init/libretranslate.service /etc/systemd/system/ sudo systemctl start libretranslate sudo systemctl enable libretranslate |