-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (57 loc) · 2.05 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
###########################################################
## Testing FHEM with a small as possible Alpine Linux
## inspired from https://github.com/krannich/dkDockerFHEM/blob/master/fhem/Dockerfile
###########################################################
FROM alpine:latest
LABEL org.opencontainers.image.authors="[email protected]"
ENV \
TERM=xterm\
TZ=Europe/Berlin
ARG PACKAGE_SIZE=small
RUN apk add --no-cache --update \
bash \
ca-certificates \
perl \
perl-device-serialport \
sed \
tzdata \
wget \
&& if [ "${PACKAGE_SIZE}" = "full" ]; then \
apk add --no-cache --update \
busybox-extras \
perl-dbd-mysql \
perl-dbi \
perl-crypt-openssl-dsa \
perl-crypt-openssl-rsa \
perl-crypt-rijndael \
perl-io-socket-ssl \
perl-json \
perl-lwp-protocol-https \
perl-net-telnet \
perl-socket \
perl-switch \
perl-sys-hostname-long \
perl-xml-simple \
subversion \
; fi \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
### ToDo combine the following parts for better building
## Customizing console
RUN echo "alias ll='ls -lah --color=auto'" >> /root/.bashrc
## Setting timezone
RUN cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
&& echo "Europe/Berlin" > /etc/timezone
## add user fhem, copy some files from github instead of using docker context
RUN adduser -G dialout -h /opt/fhem -s /bin/false -D fhem \
&& cd / \
&& wget -q https://raw.githubusercontent.com/heinz-otto/fhem-docker/main/functions.sh \
&& wget -q https://raw.githubusercontent.com/heinz-otto/fhem-docker/main/entry.sh \
&& wget -q https://raw.githubusercontent.com/heinz-otto/fhemcl/master/fhemcl.sh \
&& chmod +x /*.sh
## Starting container, EXPOSE is more Doku :-)
EXPOSE 8083
## HEALTHCHECK --interval=20s --timeout=10s --start-period=60s --retries=5 CMD /health-check.sh
WORKDIR "/opt/fhem"
ENTRYPOINT ["/entry.sh"]
# start is default and can be overwritten per commandline
CMD [ "start" ]