-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
77 lines (67 loc) · 3.16 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
# DOCKER-VERSION 0.3.8
FROM node:current-bookworm-slim
#FROM google/nodejs
#FROM node:4.4-wheezy
MAINTAINER Emmanuel PIERRE [email protected]
USER root
LABEL Description="This image is used to start the MyDomoAtHome executable" Vendor="Domoticz" Version="0.3.8"
##################################################
# Install tools #
##################################################
RUN apt-get update --fix-missing
RUN apt-get -y install sudo
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
RUN apt-get install -yq curl
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get install tzdata
RUN apt-get -y install git git-core
RUN apt-get -y install wget curl
##################################################
# Set environment variables #
##################################################
RUN apt-get install -yq apt-utils
RUN apt-get install debconf
RUN apt-get update -qq && apt-get install -y locales -qq && locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
# Ensure UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
ENV CONTAINER yes
##################################################
# Install MDAH #
##################################################
# Set the time zone
RUN echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
#VOLUME /etc/timezone /etc/localtime
##################################################
# Install MDAH #
##################################################
#RUN cachebuster=b953b35 git clone -b nodejs https://github.com/empierre/MyDomoAtHome.git dist
#RUN cd MyDomoAtHome && bash run-once.sh
#RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install -y nodejs
#RUN apt-get install -y npm
//RUN npm install -g [email protected]
RUN npm install
RUN wget http://www.e-nef.com/domoticz/mdah/node-mydomoathome-0.3.6.deb
RUN dpkg --force-all -i node-mydomoathome-0.3.6.deb
RUN mv /etc/mydomoathome/config.json /etc/mydomoathome/config.json.old
VOLUME /etc/mydomoathome/
##################################################
# Start #
##################################################
EXPOSE 3002
WORKDIR dist
ADD . dist
RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
npm install -g forever nodemon mocha supervisor
#CMD ["forever", "start","--minUptime 1000 --spinSleepTime 1000 --max-old-space-size=128", "/usr/share/mydomoathome/app/mdah.js"]
RUN cd /usr/share/mydomoathome/app/
#CMD ["forever", "/usr/share/mydomoathome/app/mdah.js"]
CMD ["forever", "-c","node --harmony","/usr/share/mydomoathome/app/mdah.js"]