Browse Source

Add argument for specifying optional dependencies

Eugene Davis 3 years ago
parent
commit
2dd7328859
2 changed files with 7 additions and 2 deletions
  1. 4 1
      Dockerfile
  2. 3 1
      Dockerfile.dev

+ 4 - 1
Dockerfile

@@ -5,9 +5,12 @@ FROM python:3-alpine as builder
 # Version of Radicale (e.g. v3)
 ARG VERSION=master
 
+# Optional dependencies (e.g. bcrypt)
+ARG DEPENDENCIES=bcrypt
+
 RUN apk add --no-cache --virtual gcc libffi-dev musl-dev \
     && python -m venv /app/venv \
-    && /app/venv/bin/pip install --no-cache-dir "Radicale[bcrypt] @ https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz"
+    && /app/venv/bin/pip install --no-cache-dir "Radicale[${DEPENDENCIES}] @ https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz"
 
 
 FROM python:3-alpine

+ 3 - 1
Dockerfile.dev

@@ -1,5 +1,7 @@
 FROM python:3-alpine as builder
 
+# Optional dependencies (e.g. bcrypt)
+ARG DEPENDENCIES=bcrypt
 
 COPY . /app
 
@@ -7,7 +9,7 @@ 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 .[bcrypt]
+    && /app/venv/bin/pip install --no-cache-dir .[${DEPENDENCIES}]
 
 FROM python:3-alpine