-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.template
37 lines (28 loc) · 1.51 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
35
36
37
# 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/
# Note the node:slim image doesn't have node-gyp
FROM resin/%%RESIN_MACHINE_NAME%%-python:3.6
# 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 -y --no-install-recommends apt-utils && \
# apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yq \
sense-hat && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN cd /usr/lib/python3/dist-packages && find . -name '*cpython-34m-arm-linux-gnueabihf*' | \
xargs -n 1 -I % bash -c 'echo cp % $(echo % | sed "s/cpython-34m-arm-linux-gnueabihf\.//g" )' | \
xargs -L 1 -I % bash -c '%'
# Defines our working directory in container
WORKDIR /usr/src/app
# Copies the package.json first for better cache on later pushes
COPY requirements.txt requirements.txt
# 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 pip install -r requirements.txt
# 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 modprobe i2c-dev && ./run.sh