When adding a package to the project, certain steps have to be taken depending on the purpose of the package
For packages that are needed for the operation of the project, the package needs to be listed in different locations depending on the purpose of installing it.
Packages that are needed to compile another package are to go in the builder container in the Dockerfile,
Any packages that are needed for continued operation of the project are to be listed in the final container in the Dockerfile.
Any python packages that are to be installed for the production version of the project must be listed, with their version number, in the requirements.pip file
For packages that are for development only purposes, select steps need to be taken for importing those packages.
To install a development only package into the OS, modify the Dockerfile file with the respective RUN command in the “DEVELOPMENT” section.
To install a development only python package, modify the file requirements.dev.pip with the python package and version required.
For a couple of the libraries used in the project it may be useful to use a local version directly instead of having to publish the code before testing
To replace the grenml package with a local version instead, mount a local version as a volume by creating and including an additional docker compose file with a volume mounting the folder on the host machine to the correct folder in the container.
The compose file should have a section for the app container, and an override for the volume
version: '3.7'
services:
app:
volumes:
- <PATH_TO_FOLDER_ON_HOST>:/home/grenmapadmin/web/grenml
This works by allowing python to look in the source directory of the project for packages prior to looking in the installed dependencies. Any package can be overridden with this same logic.
To replace the package with a local version, follow the same steps as above, but replace the path in the volumes with the appropriate folder.
version: '3.7'
services:
app:
volumes:
- <PATH_TO_FOLDER_ON_HOST>:/home/grenmapadmin/web/import_excel
To replace the package with a local version, follow the same steps as above, but replace the path in the volumes with the appropriate folder.
version: '3.7'
services:
websp:
volumes:
- <PATH_TO_DIST_FOLDER_ON_HOST>:/home/grenmapadmin/web/staticfiles/gren-map-visualization
Alternatively:
Change ‘Devdepedency’ in package.json to use local folder files replace it with /usr/src/app/staticfiles/gren-map-visualization. You can generate required files from visualiztion locally using gren-map-visualization. or use git commit id from gren-map-distribution repo to use specific version of files.
Example: git+https://github.com/grenmap/gren-map-distribution.git#756d721b243e884c9a602ebd9edc03d2eb36daf4
Copy the file(s) needed for the visualization (gren-map.js,styles.css) into the local ‘django/staticfiles/gren-map-visualization’ directory of the project after running a full compose up at least once. This should allow the file to be picked up live in development mode. This file will be overwritten on a full rebuild of the container structure, however it should be uncommon to perform a full build while in development.
Follow the instruction in SSO Document to set up your environment for one IdP and one or more MAP nodes.