Skip to content

Docker Config Details

Wenbo Tao edited this page Dec 22, 2018 · 2 revisions

tl;dr: docker-compose brings up two VMs that talk with each other and expose port 8000 for web browsers i.e. end users, and port 5432 for developers using postgres tools like psql.

The easiest way to run Kyrix is to use our docker-compose config, which creates two docker virtual machines ("containers") on your local computer - one which runs the kyrix frontend and tile-server and one which runs the postgres backend. The Kyrix container exposes port 8000 to the host OS, i.e. open a terminal and point a browser at localhost:8000 on the host OS. Strictly for debugging/developments, the postgres container exposes port 5432 so you can connect (e.g. psql) directly to postgres from the host OS. Again, this is totally optional - the Kyrix container talks directly to the postgres container, thanks to the magic of docker-compose.

To learn more, read docker-compose.yml. We rely on docker-compose v3 features, so please upgrade if you're using an older version.

FAQ: what is Docker and Docker Compose? How does it work?

tl;dr: Docker makes developers' lives much much easier because everybody has the exact same everything.

Docker works by creating fully isolated virtual machines ("containers") on your computer, making it much easier to achieve correct installations every time (learn more). Notably, docker works the same way regardless of the host OS, so developers running MacOS and servers running Ubuntu, all have the exact same OS, libraries, code, data, everything. Under the hood, Docker uses a complete "container OS" inside the container, and yes this can get "heavy" in terms of storage, networking, etc which is why we use Alpine Linux by default (but provide Ubuntu for developers as well).

Docker-compose is a tool which scripts the process of starting multiple containers in the proper order, arrange that the containers can talk (network) to each other, etc. Think of docker-compose as the master boot script for a cluster of virtual computers.