This repository was archived by the owner on Apr 9, 2026. It is now read-only.
forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.pyproject
More file actions
92 lines (79 loc) · 3.28 KB
/
Dockerfile.pyproject
File metadata and controls
92 lines (79 loc) · 3.28 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Build Core from pyproject.toml directly
ARG BUILD_FROM
FROM ${BUILD_FROM}
LABEL \
io.hass.type="core" \
org.opencontainers.image.authors="The Home Assistant Authors" \
org.opencontainers.image.description="Open-source home automation platform running on Python 3" \
org.opencontainers.image.documentation="https://www.home-assistant.io/docs/" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.source="https://github.com/my-smart-homes/core" \
org.opencontainers.image.title="My Smart Homes" \
org.opencontainers.image.url="https://www.my-smart-homes.io/"
# Synchronize with homeassistant/core.py:async_stop
ENV \
S6_SERVICES_GRACETIME=240000 \
UV_SYSTEM_PYTHON=true \
UV_NO_CACHE=true \
UV_HTTP_TIMEOUT=180
# Home Assistant S6-Overlay
COPY rootfs /
# Add go2rtc binary
COPY --from=ghcr.io/alexxit/go2rtc@sha256:f394f6329f5389a4c9a7fc54b09fdec9621bbb78bf7a672b973440bbdfb02241 /usr/local/bin/go2rtc /bin/go2rtc
RUN \
# Verify go2rtc can be executed
go2rtc --version \
# Install uv
&& pip3 install uv==0.9.17
WORKDIR /usr/src
# Install Core using pyproject.toml
COPY pyproject.toml pyproject.toml
COPY homeassistant homeassistant/
RUN \
uv pip install \
--no-build \
-e .
# Compile Python files (skip if errors)
RUN \
python3 -m compileall homeassistant/ || true
# Needs to be redefined inside the FROM statement to be set for RUN commands
ARG BUILD_ARCH
# Get go2rtc binary for specific architecture
RUN \
case "${BUILD_ARCH}" in \
"aarch64") go2rtc_suffix='arm64' ;; \
"armhf") go2rtc_suffix='armv6' ;; \
"armv7") go2rtc_suffix='arm' ;; \
*) go2rtc_suffix=${BUILD_ARCH} ;; \
esac \
&& curl -L https://github.com/AlexxIT/go2rtc/releases/download/v1.9.8/go2rtc_linux_${go2rtc_suffix} --output /bin/go2rtc \
&& chmod +x /bin/go2rtc \
# Verify go2rtc can be executed
&& go2rtc --version
# Install frp (bore)
RUN \
set -x \
&& if [ "${BUILD_ARCH}" = "amd64" ]; then \
BORE_URL="https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_amd64.tar.gz"; \
EXTRACT_DIR="frp_0.61.1_linux_amd64"; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
BORE_URL="https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_amd64.tar.gz"; \
EXTRACT_DIR="frp_0.61.1_linux_amd64"; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
BORE_URL="https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_arm64.tar.gz"; \
EXTRACT_DIR="frp_0.61.1_linux_arm64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then \
BORE_URL="https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_arm.tar.gz"; \
EXTRACT_DIR="frp_0.61.1_linux_arm"; \
elif [ "${BUILD_ARCH}" = "armhf" ]; then \
BORE_URL="https://github.com/fatedier/frp/releases/download/v0.61.1/frp_0.61.1_linux_arm_hf.tar.gz"; \
EXTRACT_DIR="frp_0.61.1_linux_arm_hf"; \
else \
echo "Unsupported architecture: ${BUILD_ARCH}"; exit 1; \
fi \
&& curl -L "$BORE_URL" --output /tmp/bore.tar.gz \
&& tar -xzf /tmp/bore.tar.gz -C /tmp/ \
&& mv "/tmp/$EXTRACT_DIR/frpc" /usr/local/bin/frpc \
&& chmod +x /usr/local/bin/frpc \
&& rm /tmp/bore.tar.gz
WORKDIR /config