-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
111 lines (93 loc) · 4.88 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM node:22.13.0-bullseye-slim@sha256:325ce775e38a3960fb5492eed4fc60bd86d48ec026e62ce73828081738de8e6b
ENV NODE_ENV=production
ARG TARGETPLATFORM
ENV TERM=xterm
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# Install base environment
COPY src/entry.sh /entry.sh
COPY src/ssh_known_hosts.txt /ssh_known_hosts.txt
COPY src/health-check.sh /health-check.sh
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends \
ca-certificates \
gnupg \
locales \
\
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
&& /usr/sbin/update-locale LANG=en_US.UTF-8 \
\
&& ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
&& echo "Europe/Berlin" > /etc/timezone \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure tzdata \
\
&& DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends \
curl \
jq \
lsb-release \
openssh-client \
&& apt-get autoremove -qqy && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.[^.] ~/.??* ~/*
ARG ALEXAFHEM_VERSION="0.5.65"
# Add alexa-fhem app layer
COPY src/package.json /opt/app/package.json
WORKDIR "/opt/app"
RUN npm install \
&& ln -s /opt/app/node_modules/alexa-fhem/bin/alexa /usr/local/bin/alexa-fhem \
&& rm -rf /tmp/* /var/tmp/* ~/.[^.] ~/.??* ~/*
# Add alexa-fhem app layer
COPY src/config.json /alexa-fhem.src/alexa-fhem-docker.config.json
# Arguments to instantiate as variables
ARG TAG=""
ARG TAG_ROLLING=""
ARG BUILD_DATE=""
ARG IMAGE_VCS_REF=""
ARG IMAGE_VERSION=""
# Re-usable variables during build
ARG L_AUTHORS="https://github.com/fhem/alexa-fhem-docker/graphs/contributors"
ARG L_URL="https://hub.docker.com/r/fhem/alexa-fhem-${TARGETPLATFORM}"
ARG L_USAGE="https://github.com/fhem/alexa-fhem-docker/blob/${IMAGE_VCS_REF}/README.md"
ARG L_VCS_URL="https://github.com/fhem/alexa-fhem-docker/"
ARG L_VENDOR="FHEM"
ARG L_LICENSES="MIT"
ARG L_TITLE="alexa-fhem-${TARGETPLATFORM}"
ARG L_DESCR="FHEM complementary Docker image for Amazon alexa voice assistant, based on Debian Bullseye."
ARG L_AUTHORS_ALEXAFHEM="https://github.com/justme-1968/alexa-fhem/graphs/contributors"
ARG L_URL_ALEXAFHEM="https://fhem.de/"
ARG L_USAGE_ALEXAFHEM="https://wiki.fhem.de/wiki/FHEM_Connector"
ARG L_VCS_URL_ALEXAFHEM="https://github.com/justme-1968/alexa-fhem"
ARG L_VENDOR_ALEXAFHEM="FHEM"
ARG L_LICENSES_ALEXAFHEM="GPL-2.0"
ARG L_DESCR_ALEXAFHEM="Amazon alexa voice assistant support for FHEM"
# annotation labels according to
# https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md#pre-defined-annotation-keys
LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.authors=${L_AUTHORS}
LABEL org.opencontainers.image.url=${L_URL}
LABEL org.opencontainers.image.documentation=${L_USAGE}
LABEL org.opencontainers.image.source=${L_VCS_URL}
LABEL org.opencontainers.image.version=${IMAGE_VERSION}
LABEL org.opencontainers.image.revision=${IMAGE_VCS_REF}
LABEL org.opencontainers.image.vendor=${L_VENDOR}
LABEL org.opencontainers.image.licenses=${L_LICENSES}
LABEL org.opencontainers.image.title=${L_TITLE}
LABEL org.opencontainers.image.description=${L_DESCR}
# non-standard labels
LABEL org.fhem.alexa.authors=${L_AUTHORS_ALEXAFHEM}
LABEL org.fhem.alexa.url=${L_URL_ALEXAFHEM}
LABEL org.fhem.alexa.documentation=${L_USAGE_ALEXAFHEM}
LABEL org.fhem.alexa.source=${L_VCS_URL_ALEXAFHEM}
LABEL org.fhem.alexa.version=${ALEXAFHEM_VERSION}
LABEL org.fhem.alexa.vendor=${L_VENDOR_ALEXAFHEM}-${TARGETPLATFORM}
LABEL org.fhem.alexa.licenses=${L_LICENSES_ALEXAFHEM}
LABEL org.fhem.alexa.description=${L_DESCR_ALEXAFHEM}
RUN echo "org.opencontainers.image.created=${BUILD_DATE}\norg.opencontainers.image.authors=${L_AUTHORS}\norg.opencontainers.image.url=${L_URL}\norg.opencontainers.image.documentation=${L_USAGE}\norg.opencontainers.image.source=${L_VCS_URL}\norg.opencontainers.image.version=${IMAGE_VERSION}\norg.opencontainers.image.revision=${IMAGE_VCS_REF}\norg.opencontainers.image.vendor=${L_VENDOR}-${TARGETPLATFORM}\norg.opencontainers.image.licenses=${L_LICENSES}\norg.opencontainers.image.title=${L_TITLE}\norg.opencontainers.image.description=${L_DESCR}\norg.fhem.alexa.authors=${L_AUTHORS_ALEXAFHEM}\norg.fhem.alexa.url=${L_URL_ALEXAFHEM}\norg.fhem.alexa.documentation=${L_USAGE_ALEXAFHEM}\norg.fhem.alexa.source=${L_VCS_URL_ALEXAFHEM}\norg.fhem.alexa.version=${ALEXAFHEM_VERSION}\norg.fhem.alexa.revision=${VCS_REF}\norg.fhem.alexa.vendor=${L_VENDOR_ALEXAFHEM}\norg.fhem.alexa.licenses=${L_LICENSES_ALEXAFHEM}\norg.fhem.alexa.description=${L_DESCR_ALEXAFHEM}" > /image_info
VOLUME [ "/alexa-fhem" ]
EXPOSE 3000
HEALTHCHECK --interval=20s --timeout=10s --start-period=10s --retries=5 CMD /health-check.sh
WORKDIR "/alexa-fhem"
ENTRYPOINT [ "/entry.sh" ]
CMD [ "start" ]