Files
anki/docs/syncserver/Dockerfile
llama 054ce44868 chore: bump rust toolchain to 1.97.1 (#5316)
## Linked issue (required)

Closes #5308 

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-08-11 14:06:50 +03:00

43 lines
1.2 KiB
Docker

FROM rust:1.97.1-alpine3.23 AS builder
ARG ANKI_VERSION
RUN apk update && apk add --no-cache build-base protobuf && rm -rf /var/cache/apk/*
RUN cargo install --git https://github.com/ankitects/anki.git \
--tag ${ANKI_VERSION} \
--root /anki-server \
--locked \
anki-sync-server
FROM alpine:3.23
# Default PUID and PGID values (can be overridden at runtime). Use these to
# ensure the files on the volume have the permissions you need.
ENV PUID=1000
ENV PGID=1000
COPY --from=builder /anki-server/bin/anki-sync-server /usr/local/bin/anki-sync-server
RUN apk update && apk add --no-cache bash su-exec && rm -rf /var/cache/apk/*
EXPOSE 8080
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["anki-sync-server"]
# Use the built-in healthcheck to avoid noisy HTTP log entries on every probe.
# The --healthcheck flag exits 0 if the server is healthy, 1 otherwise, and
# produces no stdout output — allowing Docker/k3s to surface health status
# without polluting container logs.
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD anki-sync-server --healthcheck
VOLUME /anki_data
LABEL maintainer="Jean Khawand <jk@jeankhawand.com>"