gulasch-r0mstore/deploy.md

1.7 KiB

Almost secret deployment battle plan

  1. Install dependencies: aptitude install python3 virtualenv python3-virtualenv libjpeg-dev zlib1g-dev libtiff-dev libtiff-dev libwebp-dev libopenjpeg-dev python3-dev
  2. Create linux user for running the romstore adduser --disabled-login romstore
  3. Create database + database user
  • postgres
    su postgres
    createuser -D -P -S romstore
    createdb -O romstore romstore
    
  1. git clone https://github.com/LongHairedHacker/gulasch-r0mstore/
  2. virtualenv -p python3 virtenv; source virtenv/bin/activate
  3. pip install -r requirements.txt
  4. Generate new secret key and set it in gulashromstore/settings.py: pwgen -sy 64 5
  5. Setup database in gulashromstore/settings.py
  1. Setup mail configuration https://docs.djangoproject.com/en/1.11/ref/settings/#email
  2. manage.py migrate
  3. manage.py createsuperuser
  4. manage.py collectstatic
  5. Set up a uswgi configuration (use systemd/uwsgi.ini)
    • update paths
    • update user/group ids
  6. Setup systemd service and socket files
  7. Setup nginx, see https://uwsgi.readthedocs.io/en/latest/tutorials/Django_and_nginx.html#configure-nginx-for-your-site
    • set paths for media, static and the socket
    • make sure static points to static_root not static
  8. Testrun without ssl
  9. Setup ssl
  10. Change DEBUG to False in gulashromstore/settings.py