Missing features
- manual
create a new book
page. The current way to create a new entry, is tosubmit-by-isbn
which tries retrieve info about a book from google-books and openlibrary.org. - upload files(pdf) which then can be found from the
index
page,
Remember to copy library.cfg_EXAMPLE
to library.cfg
and change env variables as needed.
NB, just a note about docker:
- image is the instructions for how to
- build and run a container
Steps to build a tagged image and run it
docker build -t library .
docker run -d --restart=always --name=dbkk-library -p 80:5000 -e FLASK_APP=controller.py library
With --restart=always
there is no need for a systemd-service file.
When pullling new code the image have to rebuild and the container deleted(stooped and recreated)
docker build -t library .
docker rm dbkk-library
docker run -d --restart=always --name=dbkk-library -p 80:5000 -e FLASK_APP=controller.py library
The old image will still exist locally, but docker images
will show as its name or tag. docker system prune
will clean up the old image.
If the container just runs a one-off test, you might delete the old container before building a new image, or use the docker run --rm
option to have the container delete itself. add --entrypoint bash
to get a shell if the app is crashing and the container exists, which prevents docker exec bash
from working.
docker run --rm -it -e FLASK_APP=controller.py -e FLASK_DEBUG=1 -p 5000:5000 library
docker run --rm -it -e FLASK_APP=controller.py -e FLASK_DEBUG=1 -p 5000:5000 --entrypoint bash library
docker run
creates and start a new container. docker start
start an already existing container.
docker-compose
mounts the code into the container so code-changes are automatically seen by the app.
docker-compose up -d # or for production
docker-compose up -d -f docker-compose.prod.yml
go to [localhost:5000] (http://localhost:5000) in the browser