Dockerfile 968 B

12345678910111213141516171819202122232425262728293031323334
  1. # This file is intended to be used apart from the containing source code tree.
  2. FROM python:3-alpine AS builder
  3. # Version of Radicale (e.g. v3)
  4. ARG VERSION=master
  5. # Optional dependencies (e.g. bcrypt or ldap)
  6. ARG DEPENDENCIES=bcrypt
  7. RUN apk add --no-cache --virtual gcc libffi-dev musl-dev \
  8. && python -m venv /app/venv \
  9. && /app/venv/bin/pip install --no-cache-dir "Radicale[${DEPENDENCIES}] @ https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz"
  10. FROM python:3-alpine
  11. WORKDIR /app
  12. RUN addgroup -g 1000 radicale \
  13. && adduser radicale --home /var/lib/radicale --system --uid 1000 --disabled-password -G radicale \
  14. && apk add --no-cache ca-certificates openssl
  15. COPY --chown=radicale:radicale --from=builder /app/venv /app
  16. # Persistent storage for data
  17. VOLUME /var/lib/radicale
  18. # TCP port of Radicale
  19. EXPOSE 5232
  20. # Run Radicale
  21. ENTRYPOINT [ "/app/bin/python", "/app/bin/radicale"]
  22. CMD ["--hosts", "0.0.0.0:5232,[::]:5232"]
  23. USER radicale