-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.template
51 lines (40 loc) · 1.29 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM resin/%%RESIN_MACHINE_NAME%%-debian:stretch
RUN apt-get update && apt-get install -yq --no-install-recommends \
python3 \
python3-pip \
python3-dev \
python3-wheel \
python3-setuptools \
alsa-utils \
rsync \
build-essential \
portaudio19-dev \
libffi-dev \
libssl-dev \
libmpg123-dev \
git && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN cp `which uname` /bin/uname-orig && echo '#!/bin/bash\nif [[ $1 == "-m" ]]; then echo "armv7l"; else /bin/uname-orig $@; fi;' > `which uname`
# Move to app dir
WORKDIR /usr/src/app
# Clone Google Assistant
RUN git clone https://github.com/google/aiyprojects-raspbian.git && \
mv aiyprojects-raspbian/src/* . && \
rm -rf aiyprojects-raspbian
# Configure PIP
COPY pip.conf /etc/pip.conf
# Move app to filesystem
COPY ./app ./
# Install Google Assistant library
RUN pip3 install --upgrade -r requirements.txt && \
echo "/usr/src/app" > /usr/lib/python3/dist-packages/aiy.pth && \
echo "/usr/src/app" > /usr/local/lib/python3.5/dist-packages/aiy.pth
# Install systemd services
COPY ./Dockerbin/alsa-init.service /lib/systemd/system/
RUN systemctl enable alsa-init.service
# Configure ALSA
COPY Dockerbin/asound.conf /etc/asound.conf
# Enable init system
# ENV INITSYSTEM on
# Start app
CMD ["bash", "/usr/src/app/start.sh"]