Created
August 22, 2017 17:53
-
-
Save SteveEdson/ab4e4b9eb05a6f2c2c6ed6974a2c16fa to your computer and use it in GitHub Desktop.
Dockerfile for project matilda
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
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