Set of deploy scripts, settings files, custom patches, translations and utilities for running Polis experiment deployments for DigiFinland.
-
Clone this repository.
git clone git@github.com:polis-digifinland-tools/polis-digifinland-tools.git
Optionally, set autocrlf if you encounter issues with line endings:
git config --global core.autocrlf true
-
Add
polis.local
entry to your local DNS or hosts file:127.0.0.1 polis.local
-
Copy
digifinland-example.env
to a new file calleddigifinland-dev.env
and edit variables to match your environment.
-
Patch Polis codebase:
./scripts/patch-polis-codebase.sh
-
Edit env variables in
digifinland-dev.env
file. -
Build and start containers with Docker Compose:
./scripts/docker-compose_build-and-deploy.sh dev
-
Browse to https://polis.local
Docker Compose deployment uses Postgres service defined in docker-compose-digifinland.yml
. Default database initialization & migration SQL scripts are run on the first startup.
If you like to use minikube and skaffold for testing Kubernetes deployment locally, either install database on your host or create a new StatefulSet deployment running database container based on polis/server/Dockerfile-db
.
To use database from host, install Postgres 13.7 and use a suitable test DB dump. Note that newer Postgres versions are not supported by Polis yet.
Example configurations assume that database service is running at host.docker.internal:5432
.
To patch Polis submodule with DigiFinland customizations and settings, run patch script before building images or running docker compose.
This fetches latest working Polis version from origin/edge
branch and adds custom configs and patches.
./scripts/patch-polis-codebase.sh
By default, configuration uses nginx container in a way it is used in the original codebase.
You can also use nginx on your host and setup load balancing proxy with example site configurations provided in the nginx
directory.
After patching, build and start all containers. Script takes env identifier (dev) as argument.
./scripts/docker-compose_build-and-deploy.sh dev
Takes env identifier (dev) as argument.
./scripts/docker-compose_stop.sh dev
Kubernetes configuration files are in ./manifests
directory.
See skaffold.yaml for artifacts and build config.
Starts local Minikube cluster with metrics and ingress addons, and starts ingress tunnel:
./scripts/k8s_start-local-minikube.sh
Builds and deploys containers using Skaffold:
skaffold run
Alternatively, to use image pruning, you can run:
skaffold dev --no-prune=false --cache-artifacts=false
Builds and pushes images to artifact registry.
Example:
./scripts/docker_images-build-and-push.sh example.com/project/repository tag-name