-
Notifications
You must be signed in to change notification settings - Fork 97
/
Dockerfile.base
59 lines (48 loc) · 1.93 KB
/
Dockerfile.base
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
56
57
58
59
# syntax=docker/dockerfile:1
# BASE docker image for music assistant container
FROM python:3.12-alpine3.20
ARG TARGETPLATFORM
RUN set -x \
&& apk add --no-cache \
ca-certificates \
jemalloc \
curl \
git \
wget \
tzdata \
sox \
cifs-utils \
# install ffmpeg from community repo
&& apk add --no-cache ffmpeg --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/community \
# install snapcast from community repo
&& apk add --no-cache snapcast --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
# install libnfs from community repo
&& apk add --no-cache libnfs --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/community \
# install openssl-dev (needed for airplay)
&& apk add --no-cache openssl-dev
# Copy widevine client files to container
RUN mkdir -p /usr/local/bin/widevine_cdm
COPY widevine_cdm/* /usr/local/bin/widevine_cdm/
WORKDIR /app
# Configure runtime environmental variables
ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
ENV VIRTUAL_ENV=/app/venv
# create python venv
RUN python3 -m venv $VIRTUAL_ENV && \
source $VIRTUAL_ENV/bin/activate && \
pip install --upgrade pip \
&& pip install uv==0.4.17
# we need to set (very permissive) permissions to the workdir
# and /tmp to allow running the container as non-root
# NOTE that home assistant add-ons always run as root (and use apparmor)
# so we can't specify a user here
RUN chmod -R 777 /app \
&& chmod -R 777 /tmp
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR $VIRTUAL_ENV
LABEL \
org.opencontainers.image.title="Music Assistant Base Image" \
org.opencontainers.image.description="Base Image for Music Assistant server - not to be used directly" \
org.opencontainers.image.source="https://github.com/music-assistant/server" \
org.opencontainers.image.authors="The Music Assistant Team" \
org.opencontainers.image.licenses="Apache License 2.0"