Skip to content

dbkk-dk/library-org

 
 

Repository files navigation

Project Status

Missing features

  • manual create a new book page. The current way to create a new entry, is to submit-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,

docker

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

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

About

Organizational system for a library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 42.9%
  • HTML 31.1%
  • SCSS 16.5%
  • JavaScript 5.7%
  • Nix 1.8%
  • Dockerfile 1.1%
  • Shell 0.9%