-
Notifications
You must be signed in to change notification settings - Fork 6
Local installation
Stefan Weil edited this page Oct 22, 2021
·
2 revisions
export LANG=C.UTF-8
# Installation Debian Pakete.
sudo apt update
sudo apt upgrade
sudo apt install --yes vim htop git curl tmux postgresql postgresql-contrib libpq-dev redis-server netcat-traditional jpegoptim pngcrush gfortran libopenblas-dev liblapack-dev libvips npm sudo
sudo apt install --yes --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
# Start Systemdienste.
sudo service postgresql start
sudo service redis-server start
# Datenbankbenutzer anlegen.
sudo -u postgres createuser -s $USER
# Datenbank anlegen.
createdb escriptorium
# Pyenv holen und einrichten.
curl https://pyenv.run | bash
sed -Ei -e '/^([^#]|$)/ {a \
export PYENV_ROOT="$HOME/.pyenv"
a \
export PATH="$PYENV_ROOT/bin:$PATH"
a \
' -e ':a' -e '$!{n;ba};}' ~/.profile
echo 'eval "$(pyenv init --path)"' >>~/.profile
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
cat <<'EOT' >> ~/.bashrc
export DJANGO_SETTINGS_MODULE=escriptorium.local_settings
EOT
# Hier ab- und wieder anmelden. Dann weiter wie folgt.
git clone https://gitlab.com/scripta/escriptorium.git
cd escriptorium/
time pyenv install 3.7.12
pyenv virtualenv 3.7.12 ocr
cd escriptorium
pyenv local ocr
pip install -U pip setuptools
pip install -r app/requirements.txt
pip install -r app/requirements-dev.txt
cp app/escriptorium/local_settings.py.example app/escriptorium/local_settings.py
sed -i "s/provideyourusernamehere/$USER/; s/# 'USER'/'USER'/" app/escriptorium/local_settings.py
echo "CELERY_TASK_ALWAYS_EAGER = True" | cat >> app/escriptorium/local_settings.py
cd front/
npm audit fix
npm install
npm run production
cd ../app/
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 0.0.0.0:8000 --settings=escriptorium.local_settings