-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.template
34 lines (26 loc) · 1.4 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
# base-image for node on any machine using a template variable,
# see more about dockerfile templates here: https://www.balena.io/docs/learn/develop/dockerfile/#dockerfile-templates
# and about resin base images here: https://www.balena.io/docs/reference/base-images/base-images/
# Note the node:slim image doesn't have node-gyp
FROM resin/%%RESIN_MACHINE_NAME%%-node:8-slim
# Defines our working directory in container
WORKDIR /usr/src/app
# Use apt-get to install dependencies.
RUN apt-get update && apt-get install -yq \
curl git build-essential dialog libnss-mdns python \
avahi-utils libavahi-compat-libdnssd-dev xsltproc && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# sudo wget bash avahi-daemon avahi-discover
# Enable systemd init system in container. Is this required?
ENV INITSYSTEM on
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
# This install dependencies on the balena build server,
# making sure to clean up the artifacts it creates in order to reduce the image size.
RUN JOBS=MAX yarn install --prod --unsafe-perm && rm -rf /tmp/*
RUN git clone https://github.com/canboat/canboat.git && cd canboat && make bin
# ENV PATH="/usr/src/app/canboat/rel/linux-armv8l:${PATH}"
# This will copy all files in our root to the working directory in the container
COPY . ./
# server.js will run when container starts up on the device
CMD ["yarn", "start"]