mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

* docs(docker): Change suggested version numbre * deps(docker): Bump rust to 1.83.0 and alpine to 3.21.0 * deps(docker): Bump rust to 1.83.0 * CONTRIBUTORS: Add my name
36 lines
No EOL
948 B
Docker
36 lines
No EOL
948 B
Docker
FROM rust:1.83.0-alpine3.20 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 \
|
|
anki-sync-server
|
|
|
|
FROM alpine:3.21.0
|
|
|
|
ARG SYNC_PORT=8080
|
|
|
|
RUN adduser -D -h /home/anki anki
|
|
|
|
COPY --from=builder /anki-server/bin/anki-sync-server /usr/local/bin/anki-sync-server
|
|
|
|
|
|
RUN apk update && apk add --no-cache bash && rm -rf /var/cache/apk/*
|
|
|
|
USER anki
|
|
|
|
ENV SYNC_PORT=${SYNC_PORT}
|
|
|
|
EXPOSE ${SYNC_PORT}
|
|
|
|
CMD ["anki-sync-server"]
|
|
|
|
# This health check will work for Anki versions 24.08.x and newer.
|
|
# For older versions, it may incorrectly report an unhealthy status, which should not be the case.
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget -qO- http://localhost:${SYNC_PORT}/health || exit 1
|
|
|
|
LABEL maintainer="Jean Khawand <jk@jeankhawand.com>" |