-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 728 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 728 Bytes
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
# Build stage for Python package
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base-python:3.11
FROM python:3.11-alpine AS builder
RUN apk add --no-cache linux-headers gcc libc-dev
WORKDIR /build
COPY pyproject.toml requirements.txt ./
COPY src/ src/
RUN pip install --no-cache-dir --prefix="/install" .
# Final stage - Home Assistant Add-on
FROM ${BUILD_FROM}
# Install evmqtt package
COPY --from=builder /install /usr/local
# Copy add-on files
COPY run.sh /
RUN chmod a+x /run.sh
# Set working directory
WORKDIR /data
# Add labels for Home Assistant
LABEL \
io.hass.name="evmqtt" \
io.hass.description="Linux input event to MQTT gateway" \
io.hass.type="addon" \
io.hass.version="1.0.0"
CMD ["/run.sh"]