главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup.sh')
-rwxr-xr-xsetup.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/setup.sh b/setup.sh
index f53d4b3..95087ee 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,5 +1,9 @@
sudo apt-get update
sudo apt-get upgrade -y
+sudo apt-get install -y vim git
+
+# Install Python
+sudo apt-get install -y python3 python3-virtualenv python-is-python3 python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools
# Install PyICU dependencies
# https://community.libretranslate.com/t/pyicu-fails-to-install-on-ubuntu-20-04/23
@@ -8,11 +12,21 @@ sudo apt-get install -y libicu-dev python3-icu pkg-config
# Install Nginx
sudo apt-get install -y nginx
+# Download LibreTranslate source
+git clone https://github.com/argosopentech/LibreTranslate.git ~/LibreTranslate
+
+# Setup virtualenv
+virtualenv ~/LibreTranslate/env
+source ~/LibreTranslate/env/bin/activate
+pip install -e ~/LibreTranslate/
+
+# Install gunicorn
+pip install gunicorn
+
# Setup systemd
sudo cp libretranslate.service /etc/systemd/system/
sudo systemctl start libretranslate
sudo systemctl enable libretranslate
-sudo systemctl status libretranslate
# Configure Nginx
sudo cp nginx /etc/nginx/sites-available/default