forked from explodingcamera/docker-ledfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (44 loc) · 1.25 KB
/
Dockerfile
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
FROM debian:12-slim as ledfx-build
ARG LEDFX_VERSION="2.0.100"
# Install dependencies
RUN set -eux && apt-get update && apt-get install -y \
gcc \
git \
cmake \
libatlas3-base \
libavformat59 \
libavcodec-dev \
portaudio19-dev \
pulseaudio \
python3 \
python3-pip \
python3-venv \
&& python3 -m venv /opt/venv \
&& . /opt/venv/bin/activate \
# aubio errors on the first pip command, however if we don't install it here, it will fail later
&& python3 -m pip install --upgrade pip wheel setuptools aubio samplerate \
&& python3 -m pip install ledfx==${LEDFX_VERSION}
FROM debian:12-slim as ledfx
ARG EXTRA_APT_PKGS=""
ENV PATH="/opt/venv/bin:$PATH"
RUN set -eux && apt-get update && apt-get install -y --no-install-recommends \
alsa-utils \
gosu \
libatlas3-base \
libavformat59 \
libavcodec59 \
libportaudio2 \
pulseaudio \
python3 \
python3-distutils \
avahi-daemon ${EXTRA_APT_PKGS}
COPY --from=ledfx-build --chown=1000:1000 /opt/venv /opt/venv
COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh \
&& useradd -u 1000 -U -d /home/ledfx -s /bin/false ledfx \
&& mkdir -p /home/ledfx \
&& chown -R ledfx:ledfx /home/ledfx \
&& usermod -G audio ledfx
# Expose the port
EXPOSE 8888
ENTRYPOINT ["/app/start.sh"]