Skip to content

Instantly share code, notes, and snippets.

@SteveEdson
Created August 22, 2017 17:53
Show Gist options
  • Save SteveEdson/ab4e4b9eb05a6f2c2c6ed6974a2c16fa to your computer and use it in GitHub Desktop.
Save SteveEdson/ab4e4b9eb05a6f2c2c6ed6974a2c16fa to your computer and use it in GitHub Desktop.
Dockerfile for project matilda
FROM resin/%%RESIN_MACHINE_NAME%%-node:slim
# switch on systemd init system in container
ENV INITSYSTEM on
COPY . /usr/src/app
WORKDIR /usr/src/app
# Copies the package.json first for better caching on later pushes
COPY package.json package.json
# Run npm install and clear the cache after, to save space
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*
# Originally, we mounted the USB disk, this was eventually removed
COPY mount /etc/systemd/system/mnt-usbdisk.mount
RUN systemctl enable mnt-usbdisk.mount
# This will copy all files in our root to the working directory in the container
COPY . ./
# The exfat formatting later turned out to be a big issue which killed our disk
RUN apt-get -q update && apt-get dist-upgrade && apt-get -y install exfat-fuse exfat-utils libraspberrypi-bin ssh rsync ftp && rm -rf /tmp/* && apt-get autoclean
# Run the start command, defined in our package.json
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment