mirror of
https://github.com/Kozea/Radicale.git
synced 2025-03-31 11:47:38 +03:00
32 lines
781 B
Text
32 lines
781 B
Text
FROM python:3-alpine AS builder
|
|
|
|
# Optional dependencies (e.g. bcrypt or ldap)
|
|
ARG DEPENDENCIES=bcrypt
|
|
|
|
COPY . /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache --virtual gcc libffi-dev musl-dev \
|
|
&& python -m venv /app/venv \
|
|
&& /app/venv/bin/pip install --no-cache-dir .[${DEPENDENCIES}]
|
|
|
|
FROM python:3-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
RUN addgroup -g 1000 radicale \
|
|
&& adduser radicale --home /var/lib/radicale --system --uid 1000 --disabled-password -G radicale \
|
|
&& apk add --no-cache ca-certificates openssl
|
|
|
|
COPY --chown=radicale:radicale --from=builder /app/venv /app
|
|
|
|
# Persistent storage for data
|
|
VOLUME /var/lib/radicale
|
|
# TCP port of Radicale
|
|
EXPOSE 5232
|
|
# Run Radicale
|
|
ENTRYPOINT [ "/app/bin/python", "/app/bin/radicale"]
|
|
CMD ["--hosts", "0.0.0.0:5232"]
|
|
|
|
USER radicale
|