forked from Glavin001/resin-homebridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
34 lines (25 loc) · 1.28 KB
/
Dockerfile.template
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
FROM resin/%%RESIN_MACHINE_NAME%%-node:latest
# Install more dependencies
RUN apt-get update \
&& apt-get install -y curl wget git python build-essential make g++ libavahi-compat-libdnssd-dev libkrb5-dev vim net-tools libnss-mdns avahi-daemon avahi-discover avahi-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Defines our working directory in container
WORKDIR /usr/src/app
# This install npm dependencies on the resin.io build server,
# making sure to clean up the artifacts it creates in order to reduce the image size.
# Install homebridge
RUN npm install --global --production homebridge --unsafe-perm
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
RUN JOBS=MAX npm install --production --unsafe-perm \
&& npm cache clean && rm -rf /tmp/*
#RUN sed -i '/^use-ipv6=/s/=.*/=no/' /etc/avahi/avahi-daemon.conf
#&& sed -i -e "s@#enable-dbus=yes@enable-dbus=no@" -e "s@#host-name=foo@host-name=$(echo $RESIN_DEVICE_UUID | cut -c1-7)@" /etc/avahi/avahi-daemon.conf
# This will copy all files in our root to the working directory in the container
COPY . ./
RUN chmod +x setup.sh
# Enable systemd init system in container
ENV INITSYSTEM on
# server.js will run when container starts up on the device
CMD ["npm", "start"]