Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #309 Make USER/PASSWORD optional #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ RUN apk add --update tzdata

FROM python:3.12.0-alpine
ARG VERSION
ARG ARGS=""
ENV USER=
ENV PASSWORD=
ENV BROKER_ADDRESS=
Expand All @@ -27,4 +28,8 @@ RUN apk --no-cache add --virtual build-dependencies build-base \
&& pip install weconnect-mqtt==${VERSION} \
&& apk del build-dependencies

CMD weconnect-mqtt --username ${USER} --password ${PASSWORD} --mqttbroker ${BROKER_ADDRESS} ${ADDITIONAL_PARAMETERS}
RUN if [ -n "${USER}" ]; then ARGS="${ARGS} --username ${USER}"; fi \
&& if [ -n "${PASSWORD}" ]; then ARGS="${ARGS} --password ${PASSWORD}"; fi \
&& if [ -n "${ADDITIONAL_PARAMETERS}" ]; then ARGS="${ARGS} ${ADDITIONAL_PARAMETERS}"; fi

CMD weconnect-mqtt --mqttbroker ${BROKER_ADDRESS} ${ARGS}