-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
# base-image for node on any machine using a template variable, | ||
# see more about dockerfile templates here: http://docs.resin.io/deployment/docker-templates/ | ||
# and about resin base images here: http://docs.resin.io/runtime/resin-base-images/ | ||
# see more about dockerfile templates here: https://www.balena.io/docs/learn/develop/dockerfile/ | ||
# and about balena 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:6 | ||
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:9-stretch-build | ||
|
||
# use apt-get if you need to install dependencies, | ||
# for instance if you need ALSA sound utils, just uncomment the lines below. | ||
#RUN apt-get update && apt-get install -yq \ | ||
# alsa-utils libasound2-dev && \ | ||
# apt-get clean && rm -rf /var/lib/apt/lists/* | ||
# use `install_packages` if you need to install dependencies, | ||
# # for instance if you need git, just uncomment the line below. | ||
# # RUN install_packages git | ||
|
||
# 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 install npm 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 npm install --production --unsafe-perm && npm cache verify && 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 | ||
# Enable udevd so that plugged dynamic hardware devices show up in our container. | ||
ENV UDEV=1 | ||
|
||
# server.js will run when container starts up on the device | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters