Observation statistics demo service.
Create a .env file in the project root (or set environment variables). Use .env.example as a template.
Required variables:
- LAJI_API_ACCESS_TOKEN: API access token for fetching data from api.laji.fi
- SECRET_KEY (required): Flask secret key used to sign sessions
docker compose up --buildThen open:
http://localhost:8080
Canonical repository: github.com/luomus/mittari.
The GitHub Actions workflow publishes images to:
ghcr.io/luomus/mittari
Important: pushing to main automatically builds and pushes a new image to GHCR, but it does not automatically roll out OpenShift deployment. See deployment instructions below.
Tools: oc is required. ./scripts/deploy-openshift.sh also needs the GitHub CLI (gh) to resolve the newest main-<sha> tag from GHCR. For a private package, run gh auth login and authorize read:packages. If you prefer not to use gh, set IMAGE_TAG explicitly (see below).
- Select the OpenShift project:
oc project mittari- Create GHCR pull secret (required if the image is private):
Use a GitHub personal access token with read:packages (and org access as required).
oc create secret docker-registry ghcr-pull-secret \
--docker-server=ghcr.io \
--docker-username=<github-username> \
--docker-password=<github-token-with-read-packages> \
--docker-email=<email> \
--dry-run=client -o yaml | oc apply -f -- Create app resources from template:
oc process -f openshift/mittari-app.yaml | oc apply -f -- Sync runtime environment from local
.envto OpenShift Secret + ConfigMap:
./scripts/sync-openshift-env.sh- After the first successful workflow run on
main, point the deployment at a real tag (the template may reference:latestbefore it exists):
./scripts/deploy-openshift.shIf gh cannot list the package (for example HTTP 404), set IMAGE_TAG to a value from Packages on this repo instead of relying on auto-discovery.
Or set a tag you see under Packages on GitHub, for example:
IMAGE_TAG=latest ./scripts/deploy-openshift.sh- Verify:
oc rollout status deployment/mittari
oc get pods
oc get route mittariOpen the HTTPS route URL in your browser.
- Push code changes to
main:
git push origin main-
Wait for GitHub Actions workflow
Build and Push Docker Imageto finish successfully. -
Deploy newest image to OpenShift (this also syncs
.envby default):
./scripts/deploy-openshift.sh- Verify rollout and running image:
oc rollout status deployment/mittari
oc get pods
oc get deployment mittari -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'IMAGE_TAG=main-0dff309 ./scripts/deploy-openshift.sh./scripts/sync-openshift-env.sh
oc rollout status deployment/mittari