-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-2stage-1
53 lines (44 loc) · 1.24 KB
/
Dockerfile-2stage-1
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
# Create docker image from python3.7-slim
FROM python:3.7-slim AS compile-image
# Set the working directory in the container
WORKDIR /ledfx
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
build-essential \
nodejs \
npm
RUN apt-get install -y \
alsa-utils \
git \
# libasound2 \
# libasound2-plugins \
portaudio19-dev
RUN git clone https://github.com/THATDONFC/ledfx -b dev /ledfx
RUN cd /ledfx/frontend \
&& npm install -g yarn \
&& yarn \
&& yarn build \
&& cd ..
RUN python -m venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
RUN pip install -r requirements.txt
RUN pip install .
# Create docker image from python3.7-slim
FROM python:3.7-slim AS build-image
COPY --from=compile-image /ledfx/venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
RUN apt-get update && apt-get install -y \
alsa-utils \
libasound2 \
libasound2-plugins \
portaudio19-dev \
&& apt-get clean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home ledfx
WORKDIR /home/ledfx
USER ledfx
EXPOSE 8888/tcp
EXPOSE 5353/udp
ENTRYPOINT [ "ledfx"]
CMD ["--host 0.0.0.0","--port 8888"]