-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-armv7
55 lines (45 loc) · 1.61 KB
/
Dockerfile-armv7
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
52
53
54
55
# Create docker image from arm32v7/python:3.9-slim
# This image serves as the base compile image
############### COMPILE IMAGE ###############
FROM arm32v7/python:3.9-slim AS compile-image
# Create python venv and add it to PATH
RUN python -m venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
# Install compile dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
# build-essential libc-dev \
gcc \
&& apt-get install -y \
# alsa-utils libasound2 libasound2-plugins \
libatlas3-base \
portaudio19-dev \
# pulseaudio \
python3-dev
########## VENV IMAGE ##########
FROM compile-image AS venv-image
RUN pip install --upgrade pip wheel setuptools
RUN pip install Cython
ARG LEDFX_PYPI='ledfx-dev'
RUN pip install $LEDFX_PYPI
# Create arm32v7/python:3.9-slim image
# This image copies /ledfx/venv from compile-image for a smaller final image
############### BUILD IMAGE ###############
FROM arm32v7/python:3.9-slim AS build-image
COPY --from=venv-image /ledfx/venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
WORKDIR /ledfx
# Install system dependencies for ledfx
RUN apt-get update && apt-get install -y --no-install-recommends \
alsa-utils \
libatlas3-base \
portaudio19-dev \
&& rm -rf /var/lib/apt/lists/*
# Add user `ledfx` and create home folder
RUN useradd --create-home ledfx --groups audio
# Set the working directory in the container
WORKDIR /home/ledfx
USER ledfx
# Expose port 8888 for web server
EXPOSE 8888/tcp
ENTRYPOINT [ "ledfx"]
CMD ["--host 0.0.0.0"]