-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
61 lines (50 loc) · 1.68 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
# base-image for node on any machine using a template variable,
# see more about dockerfile templates here:http://docs.resin.io/pages/deployment/docker-templates
# Note the node:slim image doesn't have node-gyp
FROM resin/%%RESIN_MACHINE_NAME%%-alpine-node:latest
# Defines our working directory in container
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app
# Set npm
RUN npm config set unsafe-perm true
#Install build dependencies for platformIO
RUN apk update && apk upgrade && apk add avr-libc avrdude
# Install PlatformIO
RUN python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)"
# 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.
RUN JOBS=MAX npm install -g node-red \
onoff \
node-red-contrib-resinio \
serialport \
node-red-admin \
node-red-contrib-os \
#i2c \
#i2c-bus \
#node-red-contrib-i2c \
#node-red-contrib-brads-i2c-nodes \
node-red-node-serialport \
node-grovepi \
sleep \
node-red-contrib-grovepi \
#node-red-node-grovepi \
node-red-grovepi-nodes node-red-contrib-1wire \
#ds18b20 \
#node-red-contrib-sensor-ds18b20 \
#node-red-contrib-ds18b20-sensor \
#node-red-contrib-ds18b20 \
node-red-contrib-bigtimer \
node-red-contrib-couchdb \
node-red-contrib-gpio \
node-red-dashboard \
&& \
npm link onoff \
&& \
npm cache clean --force && rm -rf /tmp/*
#RUN apk del make gcc g++ python
# This will copy all files in our root to the working directory in the container
COPY ./app ./
# Enable systemd init system in container
ENV INITSYSTEM=on
# server.js will run when container starts up on the device
CMD ["bash", "/usr/src/app/start.sh"]