Docker ( Recommended )
Docker Compose File
-
Create a new schema in your database for Kōji
-
If you have an existing
docker-compose.yml
file, copy the below service into it. Otherwise create a new file (touch docker-compose.yml
) and copy the below service into it.
version: '2'
services:
koji:
image: ghcr.io/turtiesocks/koji:main
container_name: koji
command: 'koji'
restart: unless-stopped
environment:
# To escape special characters you must surround the values with single quotes ('')
# Commented out variables are optional
# Your Golbat or RDM database
SCANNER_DB_URL: 'mysql://rdm_user:rdm_password@host:3306/rdm_database'
# Your Flygon (if using) or RDM database (if you're using a hybrid Golbat/RDM setup)
# CONTROLLER_DB_URL: 'mysql://flygon_user:flygon_password@host:3306/flygon_database'
# Your Koji database
KOJI_DB_URL: 'mysql://koji_user:koji_password@127.0.0.1:3306/koji_database'
# Max Database connections
# MAX_CONNECTIONS: 100
# Your Koji API bearer token and client password
KOJI_SECRET: 'your_super_secret'
# Start latitude on initial client load
# START_LAT: 0
# Start longitude on initial client load
# START_LON: 0
# Nominatim URl used for searching and importing geofences from OSM
# NOMINATIM_URL: 'https://nominatim.openstreetmap.org' # highly recommended using your own
# Logging level | error | warn | info | debug | trace
# LOG_LEVEL: info
# Memory limit for docker container
# mem_limit: 2048G
# Memory reservation for docker container
# mem_reservation: 256M
# CPU limit for docker container
# cpus: 2
ports:
- '8080:8080' # change left one for external port
# Optional: Might be required if your database is also hosted in docker
# network_mode: "host"
# extra_hosts:
# - "host.docker.internal:host-gateway"
Docker Setup
💡
If this is the first time using GitHub container registry you will need to login. When prompted use your personal access token not password. More info (opens in a new tab)
docker login ghcr.io -u GITHUB_USERNAME
-
After editing, pull the repo
docker-compose pull
-
Start the containers
docker-compose up -d
Docker Updating
-
Pull latest
docker-compose pull
-
Restart the container
docker-compose down && docker-compose up -d
Checking out other PRs
To check out other PRs/branches, you can change your docker-compose.override.yml
file like so:
services:
...
koji:
image: ghcr.io/turtiesocks/koji:{branch_name} # ghcr.io/turtiesocks/koji:another-clustering-algo
container_name: koji
...