forked from empierre/MyDomoAtHome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.test
76 lines (66 loc) · 2.88 KB
/
Dockerfile.test
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
# DOCKER-VERSION 0.3.4
#FROM ubuntu:14.10
#FROM node:4-slim
#FROM google/nodejs
FROM node:4.4-wheezy
MAINTAINER Emmanuel PIERRE epierre@e-nef.com
#RUN groupadd -r pi && useradd -r -g pi pi
#USER pi
USER root
LABEL Description="This image is used to start the MyDomoAtHome executable" Vendor="Domoticz" Version="1.0"
##################################################
# 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
##################################################
# 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_4.x | bash -
RUN apt-get install -y nodejs
#RUN apt-get install npm
RUN npm install -g npm@2.x
#RUN wget http://www.e-nef.com/domoticz/mdah/node-mydomoathome-0.0.49.deb
#COPY /home/in/MyDomoAtHome/binary/node-mydomoathome-latest.deb .
VOLUME /home/in/MyDomoAtHome/binary/ binary/
ADD . dist
RUN dpkg -i dist/binary/node-mydomoathome-latest.deb
RUN mv /etc/mydomoathome/config.json /etc/mydomoathome/config.json.old
RUN dpkg -i dist/binary/node-mydomoathome-latest.deb
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"]