Skip to content

Commit 3db18ff

Browse files
Add docker files (#139)
1 parent 2e4d9a9 commit 3db18ff

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

Dockerfile.dev

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM debian:bullseye as base
2+
3+
# Set shell
4+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
5+
6+
ARG MATTER_SERVER_VERSION=1.0.7
7+
ARG HOME_ASSISTANT_CHIP_VERSION=2022.11.1
8+
9+
WORKDIR /app
10+
11+
RUN \
12+
set -x \
13+
&& apt-get update \
14+
&& apt-get install -y --no-install-recommends \
15+
libuv1 \
16+
openssl \
17+
zlib1g \
18+
libjson-c5 \
19+
python3-venv \
20+
python3-pip \
21+
python3-gi \
22+
python3-gi-cairo \
23+
python3-dbus \
24+
python3-psutil \
25+
unzip \
26+
libcairo2 \
27+
gdb \
28+
git \
29+
&& git clone --depth 1 -b master \
30+
https://github.com/project-chip/connectedhomeip \
31+
&& cp -r connectedhomeip/credentials /root/credentials \
32+
&& rm -rf connectedhomeip \
33+
&& apt-get purge -y --auto-remove \
34+
git \
35+
&& rm -rf /var/lib/apt/lists/* \
36+
&& rm -rf /usr/src/*
37+
38+
# hadolint ignore=DL3013
39+
RUN \
40+
pip3 install \
41+
home-assistant-chip-clusters==${HOME_ASSISTANT_CHIP_VERSION} \
42+
home-assistant-chip-core==${HOME_ASSISTANT_CHIP_VERSION} \
43+
&& pip3 install --no-cache-dir python-matter-server=="${MATTER_SERVER_VERSION}"
44+
45+
COPY docker-entrypoint.sh ./
46+
47+
VOLUME ["/data"]
48+
EXPOSE 5580
49+
50+
ENTRYPOINT ["./docker-entrypoint.sh"]

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,18 @@ Please note that development is only possible on Linux and MacOS, no Windows sup
159159
- Download/clone the repo to your local machine.
160160
- Create a Python virtual environment.
161161
- Install the correct SDK wheels for both the cluster and core package, see instructions above if there is no wheel for your setup prebuilt.
162+
163+
## Dockerfile
164+
165+
### Build
166+
167+
```sh
168+
docker-compose build --no-cache matter-server
169+
```
170+
171+
### Run
172+
173+
```sh
174+
docker-compose up -d matter-server
175+
docker-compose logs -f matter-server
176+
```

docker-compose.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "3.8"
2+
services:
3+
# python-matter-server
4+
matter-server:
5+
build:
6+
context: ./
7+
dockerfile: Dockerfile.dev
8+
image: matter-server:latest
9+
container_name: matter-server
10+
restart: always
11+
security_opt:
12+
# needed for bluetooth via dbus
13+
- apparmor:unconfined
14+
ports:
15+
- "5580:5580"
16+
volumes:
17+
# Create an .env file that sets the USERDIR environment variable.
18+
- ${USERDIR}/docker/matter-server/data:/data/
19+
- /run/dbus:/run/dbus:ro

docker-entrypoint.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
set -e
3+
4+
set -- matter-server --storage-path /data "$@"
5+
6+
echo "Starting server:" "$@"
7+
exec "$@"

0 commit comments

Comments
 (0)