Anki/docs/syncserver/Dockerfile
Jean Khawand a694889bca
🐬Containerize anki-sync-server (#3036)
* 🐬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
2024-03-01 15:15:02 +07:00

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>"