Deploying
Each environment (dev, staging, prod) is one server running the whole stack: Postgres, Redis, the api, the worker and Caddy, which gets the HTTPS certificates for your domain. Any Debian or Ubuntu server with a public address will do.
Before the first deploy
- Point your domain and its
api.andadmin.names (and the others ininfra/caddy/Caddyfile) at the server. - In
.env.prod: the server's address and login (ANSIBLE_HOST,ANSIBLE_REMOTE_USER,ANSIBLE_SSH_KEY),REPO_URL(an address the server can clone, with a read-only deploy key for a private repository) andIMAGE_REGISTRY(such asghcr.io/<your GitHub owner>). - Sign Docker in to your registry on your machine:
docker login ghcr.io.
Deploy
make ansible-setup Env=prod # once: Docker, compose, make, swap, log limits
make images Env=prod # this commit's api, worker and web images, pushed
make ansible-deploy Env=prod # check out the commit there, pull, migrate, start
make ansible-logs Env=prod # the containers' last linesThe images are built on your machine for linux/amd64; for an arm64 server, set IMAGE_PLATFORM=linux/arm64. The server never builds: it pulls the images of the commit you deploy.
make check-infra checks the deploy files without deploying: the compose files, the scripts, the Caddyfile and the playbooks.