anki/docs/syncserver
Jean Khawand 56a085bc21
Update base images and introduce health endpoint (#3273)
* Update base images and introduce health endpoint

sync-server: introduce `/health` endpoint to check if the service is reachable.

bump(alpine): bump alpine base image from `3.19` to `3.20`

bump(rust): bump rust-alpine build image from `1.76` to `1.79`

* fix cargo fmt

* add allow clippy::extra_unused_type_parameters

* Remove unused type param (dae)

* Route /health directly (dae)

* Fix for latest axum (dae)
2024-07-10 20:35:21 +07:00
..
Dockerfile Update base images and introduce health endpoint (#3273) 2024-07-10 20:35:21 +07:00
README.md 🐬Containerize anki-sync-server (#3036) 2024-03-01 15:15:02 +07:00

README.md

Building and running Anki sync server in Docker

This is an example Dockerfile contributed by an Anki user, which shows how you can run a self-hosted sync server, similar to what AnkiWeb.net offers.

Building and running the sync server within a container has the advantage of fully isolating the build products and runtime dependencies from the rest of your system.

Requirements

Building image

To proceed with building, you must specify the Anki version you want, by replacing <version> with something like 23.12.1.

# Ensure you are running this command inside /docs/syncserver
docker build --no-cache --build-arg ANKI_VERSION=<version> -t anki-sync-server .

Run container

Once done with build, you can proceed with running this image with the following command:

# this will create anki server
docker run -d  -e "SYNC_USER1=admin:admin" -p 8080:8080 --name anki-sync-server anki-sync-server

However, if you want to have multiple users, you have to use the following approach:

# this will create anki server with multiple users
docker run -d -e "SYNC_USER1=test:test" -e "SYNC_USER2=test2:test2" -p 8080:8080 --name anki-sync-server anki-sync-server

Moreover, you can pass additional env vars mentioned here