
# Docker setup (no provided docker image atm)
1. clone the repo
2. rename ./calireWebCompanion/settings.json.bak to settings.json
3. change the secret key
4. run `build --tag calibreweb:1.0  . -f ./deployment/Dockerfile` to build the image
5. run your container with your bind/mount your volumes/paths/things 
Here's an example of step 5
```
docker run --publish 80:80 \
-v '/home/MassiveAtoms/Desktop/logs:/app/data' \
-v '/home/MassiveAtoms/windows/Users/MassiveAtoms/Documents/Calibre\ Library/:/app/calibredir' \
--name cw calibreweb:1.0
```

your Calibre path/volume/whatever needs to be mounted at `/app/calibredir`, and you need to mount a volume for the db and logs at `/app/data`

Issues with it at the moment:
1. we still need to do something to create a random secret key. Atm, this would still 

# Docker (provided image)
not done yet

# non docker setup
this might need to be modified, since some things have changed to adapt it for docker setup
1. clone repo
2. pip install -r requirements.txt
3. rename the settings.json.bak to settings.json, change logging folder, change secret key, set isdocker to false
4. install gunicorn and nginx
5. move this nginx.conf to /etc/nginx
6. create a user and group `www`
7. make whatever user nginx runs as (for now, www) the owner of calibredir
8. give execute permissions to parent of calibredir
9. cd to repo, run `gunicorn CalibreWebCompanion.wsgi`
10. start nginx `sudo systemctl restart nginx`
11. make steps 9 and 10 happen on startup?

Slight issues with this atm:
1. where to do ssl?


Suggestions: 
1. We might want to use sockets instead of ip/port?
2. autostart gunicorn/nginx
3. some extra instrumentation for gunicorn https://docs.gunicorn.org/en/latest/deploy.html
