(last edit: 4/24/2023)
KAN Portal is packaged as a Docker container. We provide a Makefile
for building the container and pushing the container to a container registry.
- Docker
NOTE: Some tools we use work better with access to docker commands without sudo. Use Docker Desktop version when possible. Otherwise, you need to add your user to docker group (see instructions). Please don't use rootless model, which isn't supported by some of the tools.
- make and gcc
sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install make gcc -y
- Helm (optional for building Helm chart)
Maintain a .env
file under the portal folder with the following environment variables:
- Container registry:
CONTAINER_REGISTRY_NAME="kanprod.azurecr.io" # replace with your own container registry name
- Azure application insights:
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY="testinstkey" APPLICATIONINSIGHTS_INGESTION_ENDPOINT="https://testinsight.in.applicationinsights.azure.com/" APPLICATIONINSIGHTS_TENANT_ID="app-insight-tenant-id" APPLICATIONINSIGHTS_CLIENT_ID="app-insight-client-id" APPLICATIONINSIGHTS_CLIENT_SECRET="app-insight-client-secret"
- Django secret:
SECRET_KEY="django-secret-key"
NOTE: Django SECRET_KEY is a random string needed when starting django apps, which requires 50 characters in length with a minimum 5 unique characters.
export MODULE_VERSION=<version>
The built container will be tagged as <CONTAINER_REGISTRY_NAME>/kanportal:<version>-<CPU architecture>
, such as kanprod.azurecr.io/kanportal:0.41.46-amd64
.
NOTE: The current
Makefile
builds foramd64
only.
Build webmodule image
# under src/portal folder
. .env # apply environment variables
export WEBMODULE_PATH=./modules/webmodule
make build
Push webmodule image
make push