forked from balena-io-experimental/blinkt-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
26 lines (19 loc) · 894 Bytes
/
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
# Note the node:slim image doesn't have node-gyp, so we use full master
FROM resin/%%RESIN_MACHINE_NAME%%-node
# Installing WiringPi Library Package
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -yq wiringpi
RUN apt-get install -yq nodejs
# Defines our working directory in container
WORKDIR /usr/src/app
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
# 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 --production --unsafe-perm && npm cache clean && rm -rf /tmp/*
# This will copy all files in our root to the working directory in the container
COPY . ./
# Enable systemd init system in container
ENV INITSYSTEM on
# server.js will run when container starts up on the device
CMD ["npm", "start"]