forked from basnijholt/home-assistant-streamdeck-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (39 loc) · 1.3 KB
/
Dockerfile
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
FROM python:3.11-alpine3.17
# Install dependencies
RUN apk --update --no-cache add \
# Stream Deck dependencies
libusb \
libusb-dev \
hidapi-dev \
libffi-dev \
# Needed for cairosvg
cairo-dev \
# Needed for lxml
libxml2-dev libxslt-dev \
# Needed for Pillow
jpeg-dev zlib-dev freetype-dev libpng-dev \
# Openblas for Matplotlib (numpy)
openblas-dev \
# Needed for pip install
&& apk add --no-cache --virtual build-deps \
# General
gcc python3-dev musl-dev \
# Needed for matplotlib
g++ gfortran py-pip build-base wget
# Add udev rule for the Stream Deck
RUN mkdir -p /etc/udev/rules.d && \
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fd9", GROUP="users", TAG+="uaccess"' > /etc/udev/rules.d/99-streamdeck.rules
# Set the working directory to the repository
WORKDIR /app
# Copy the dependencies file for pip
COPY pyproject.toml /app/
# Install the required dependencies
RUN pip3 install -e ".[colormap]" --no-cache-dir && \
# Remove musl-dev and gcc
apk del build-deps && \
rm -rf /var/cache/apk/*
# Copy the rest of the files
# This is done after the pip install to make sure that the dependencies are cached
COPY . /app
# Set the entrypoint to run the application
ENTRYPOINT ["/bin/sh", "-c", "home-assistant-streamdeck-yaml"]