-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:eb04110
#ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:8.1.3
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base system
ARG BUILD_ARCH=amd64
# update python version
#RUN apt -y install python3.13 python3.13-venv
# Install requirements for add-on
RUN \
apk add --no-cache \
python3 py3-pip \
py3-pydantic py3-pyserial py3-paho-mqtt
RUN python -m venv /opt/venv
# Enable venv
ENV PATH="/opt/venv/bin:$PATH"
#RUN pip3 install pip install --no-binary pydantic pydantic~=1.10.10
#RUN pip3 install pip install --no-binary pydantic
#RUN pip3 install pyserial~=3.5 paho-mqtt~=1.6.1 homeassistant~=2023.10.5 setuptools~=68.2.0 StrEnum~=0.4.15 ha-mqtt-discoverable~=0.9.0
RUN pip3 install homeassistant
RUN pip3 install setuptools
RUN pip3 install StrEnum
RUN pip3 install ha-mqtt-discoverable
# Python 3 HTTP Server serves the current working dir
# So let's set it to our add-on persistent data directory.
WORKDIR /data
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
COPY ./ /pylontech/
RUN chmod a+x /pylontech/examples/mqtt/PylontechMqtt.py
RUN pip3 install /pylontech
CMD [ "/run.sh" ]