Dockerfile.dev 773 B

1234567891011121314151617181920212223242526272829303132
  1. FROM python:3-alpine as builder
  2. # Optional dependencies (e.g. bcrypt)
  3. ARG DEPENDENCIES=bcrypt
  4. COPY . /app
  5. WORKDIR /app
  6. RUN apk add --no-cache --virtual gcc libffi-dev musl-dev \
  7. && python -m venv /app/venv \
  8. && /app/venv/bin/pip install --no-cache-dir .[${DEPENDENCIES}]
  9. FROM python:3-alpine
  10. WORKDIR /app
  11. RUN addgroup -g 1000 radicale \
  12. && adduser radicale --home /var/lib/radicale --system --uid 1000 --disabled-password -G radicale \
  13. && apk add --no-cache ca-certificates openssl
  14. COPY --chown=radicale:radicale --from=builder /app/venv /app
  15. # Persistent storage for data
  16. VOLUME /var/lib/radicale
  17. # TCP port of Radicale
  18. EXPOSE 5232
  19. # Run Radicale
  20. ENTRYPOINT [ "/app/bin/python", "/app/bin/radicale"]
  21. CMD ["--hosts", "0.0.0.0:5232"]
  22. USER radicale