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

* 🐬Containerize anki-sync-server
* rename directory to syncserver
* update contributors
* fix format
* format README
* - make ANKI_VERSION mandatory
- remove SYNC_USERS and stick unique vars
- update doc
* update doc
* update doc
* - remove hardcoded ANKI_VERSION arg
- update readme
32 lines
No EOL
880 B
Docker
32 lines
No EOL
880 B
Docker
FROM rust:1.76-alpine3.19 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.19.1
|
|
|
|
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:-"8080"}
|
|
|
|
EXPOSE ${SYNC_PORT}
|
|
|
|
CMD ["anki-sync-server"]
|
|
|
|
# TODO - consider exposing endpoint /health to check on health cause currently it will return 404 error
|
|
# HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
# CMD wget -qO- http://localhost:${SYNC_PORT} || exit 1
|
|
|
|
LABEL maintainer="Jean Khawand <jk@jeankhawand.com>" |