Skip to content

Commit 662ad3a

Browse files
committed
expose custom params for Docker
1 parent 7adb1a7 commit 662ad3a

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Dockerfile

+27-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,36 @@ RUN conda install portaudio pysoundfile ffmpeg -c conda-forge
3939
RUN pip install -e .
4040

4141
# Expose the port the app runs on
42-
EXPOSE 8080
42+
EXPOSE 7007
4343

4444
# Define environment variable to prevent Python from buffering stdout/stderr
4545
# and writing byte code to file
4646
ENV PYTHONUNBUFFERED=1
4747
ENV PYTHONDONTWRITEBYTECODE=1
4848

49-
CMD ["python", "-m", "diart.console.serve", "--host", "0.0.0.0", "--port", "7007", "--segmentation", "pyannote/segmentation-3.0", "--embedding", "speechbrain/spkrec-resnet-voxceleb", "--tau-active", "0.45", "--rho-update", "0.25", "--delta-new", "0.6", "--latency", "5", "--max-speakers", "3"]
49+
# Define custom options as env variables with defaults
50+
ENV HOST=0.0.0.0
51+
ENV PORT=7007
52+
ENV SEGMENTATION=pyannote/segmentation-3.0
53+
ENV EMBEDDING=speechbrain/spkrec-resnet-voxceleb
54+
ENV TAU_ACTIVE=0.45
55+
ENV RHO_UPDATE=0.25
56+
ENV DELTA_NEW=0.6
57+
ENV LATENCY=5
58+
ENV MAX_SPEAKERS=3
59+
60+
CMD ["sh", "-c", "python -m diart.console.serve --host ${HOST} --port ${PORT} --segmentation ${SEGMENTATION} --embedding ${EMBEDDING} --tau-active ${TAU_ACTIVE} --rho-update ${RHO_UPDATE} --delta-new ${DELTA_NEW} --latency ${LATENCY} --max-speakers ${MAX_SPEAKERS}"]
61+
62+
# Example run command with environment variables:
63+
# docker run -p 7007:7007 --restart unless-stopped --gpus all \
64+
# -e HF_TOKEN=<token> \
65+
# -e HOST=0.0.0.0 \
66+
# -e PORT=7007 \
67+
# -e SEGMENTATION=pyannote/segmentation-3.0 \
68+
# -e EMBEDDING=speechbrain/spkrec-resnet-voxceleb \
69+
# -e TAU_ACTIVE=0.45 \
70+
# -e RHO_UPDATE=0.25 \
71+
# -e DELTA_NEW=0.6 \
72+
# -e LATENCY=5 \
73+
# -e MAX_SPEAKERS=3 \
74+
# diart-image

0 commit comments

Comments
 (0)