-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
46 lines (34 loc) · 1.21 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 node:18-alpine
RUN apk --no-cache add git
COPY package.json /smartbed-mqtt/
COPY yarn.lock /smartbed-mqtt/
WORKDIR /smartbed-mqtt
RUN yarn install
COPY src /smartbed-mqtt/src/
COPY tsconfig.build.json /smartbed-mqtt/
COPY tsconfig.json /smartbed-mqtt/
RUN yarn build:ci
FROM node:18-alpine
# Add env
ENV LANG C.UTF-8
RUN apk add --no-cache bash curl jq && \
curl -J -L -o /tmp/bashio.tar.gz "https://github.com/hassio-addons/bashio/archive/v0.13.1.tar.gz" && \
mkdir /tmp/bashio && \
tar zxvf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /smartbed-mqtt
COPY run.sh /smartbed-mqtt/
RUN chmod a+x run.sh
COPY --from=0 /smartbed-mqtt/dist/tsc/ /smartbed-mqtt/
COPY --from=0 /smartbed-mqtt/node_modules /smartbed-mqtt/node_modules
ENTRYPOINT [ "/smartbed-mqtt/run.sh" ]
#ENTRYPOINT [ "node", "index.js" ]
LABEL \
io.hass.name="Smartbed Integration via MQTT" \
io.hass.description="Home Assistant Community Add-on for Smartbeds" \
io.hass.type="addon" \
io.hass.version="1.1.18" \
maintainer="Richard Hopton <[email protected]>"