-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile.template
69 lines (54 loc) · 1.82 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
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
FROM resin/%%RESIN_MACHINE_NAME%%-node:slim
# Install wget and curl
RUN apt-get clean && apt-get update && apt-get install -y \
wget \
curl
# Add Kodi-16 apt source
RUN echo "deb http://pipplware.pplware.pt/pipplware/dists/jessie/main/binary /" \
>> /etc/apt/sources.list.d/pipplware_jessie.list && \
wget -O - http://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -
# WTF is going on with httpredir from debian? removing it the dirty way
RUN sed -i "[email protected]@`curl -s -D - http://httpredir.debian.org/demo/debian/ | awk '/^Link:/ { print $2 }' | sed -e 's@<http://\(.*\)/debian/>;@\1@g'`@" /etc/apt/sources.list
# Install apt deps
RUN apt-get clean && apt-get update && apt-get upgrade -y && apt-get install -y \
apt-utils \
build-essential \
libasound2-dev \
libffi-dev \
libssl-dev \
python-dev \
python-pip \
git \
alsa-base \
alsa-utils \
kodi && rm -rf /var/lib/apt/lists/*
# Configure for Kodi
COPY ./Dockerbin/99-input.rules /etc/udev/rules.d/99-input.rules
COPY ./Dockerbin/10-permissions.rules /etc/udev/rules.d/10-permissions.rules
RUN addgroup --system input && \
usermod -a -G audio root && \
usermod -a -G video root && \
usermod -a -G input root && \
usermod -a -G dialout root && \
usermod -a -G plugdev root && \
usermod -a -G tty root
# Set npm
RUN npm config set unsafe-perm true
# Uncomment if you want to Configure for pHAT DAC
# COPY ./Dockerbin/asound.conf /etc/asound.conf
# Save source folder
RUN printf "%s\n" "${PWD##}" > SOURCEFOLDER
# Move to app dir
WORKDIR /usr/src/app
# Move package.json to filesystem
COPY "$SOURCEFOLDER/app/package.json" ./
# NPM i app
RUN JOBS=MAX npm i --production
# Move app to filesystem
COPY "$SOURCEFOLDER/app" ./
# Move to /
WORKDIR /
## uncomment if you want systemd
ENV INITSYSTEM on
# Start app
CMD ["bash", "/usr/src/app/start.sh"]