Did you know that there is an example Dockerfile for Self-Hosted Sync Server in Anki’s GitHub repository? If you haven’t tried it yet, you might want to give it a try first.
Here is a screencast of me trying out the Dockerfile in the repository. (Incidentally, this is my first time trying out the Self-Hosted Sync Server feature.)
The compose.yaml
used in the video is below. I am not familiar with Docker at all, so there may be a more appropriate way to write compose.yaml
.
compose.yaml
services:
anki-sync-server:
container_name: anki-sync-server
build:
context: .
args:
ANKI_VERSION: 24.06.3
tty: true
environment:
- SYNC_USER1=username:password
- SYNC_BASE=/.syncserver
volumes:
- ./.syncserver:/.syncserver
ports:
- "8080:8080"
Just FYI, when posting code, commands, or configuration files (like Dockerfile
or docker-compose.yml
), it’s generally more helpful to paste them as text rather than screenshots. This way, it’s easier for others to copy, test, and provide accurate answers. Plus, text can be searched, which is a huge benefit for anyone looking at the thread in the future.
For more tips on how to ask technical questions effectively, you might find Stack Overflow’s How to create a Minimal, Reproducible Example page useful.