-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (53 loc) · 1.36 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
51
52
53
54
55
56
57
58
FROM alpine:3.20 AS builder-taglib
WORKDIR /tmp
COPY alpine/taglib/APKBUILD .
RUN apk update && \
apk add --no-cache abuild alpine-sdk && \
abuild-keygen -a -n && \
cp /root/.abuild/*.pub /etc/apk/keys/ && \
REPODEST=/pkgs abuild -F -r
FROM golang:1.22-alpine AS builder
RUN apk add -U --no-cache \
build-base \
ca-certificates \
git \
sqlite \
zlib-dev \
go
# TODO: delete this block when taglib v2 is on alpine packages
COPY --from=builder-taglib /pkgs/*/*.apk /pkgs/
RUN apk add --no-cache --allow-untrusted /pkgs/*
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN GOOS=linux go build -o musiqlx cmd/musiqlx/musiqlx.go
FROM alpine:3.20
LABEL org.opencontainers.image.source https://github.com/sonroyaalmerol/musiqlx
RUN apk add -U --no-cache \
ffmpeg \
mpv \
ca-certificates \
tzdata \
tini \
shared-mime-info
COPY --from=builder \
/usr/lib/libgcc_s.so.1 \
/usr/lib/libstdc++.so.6 \
/usr/lib/libtag.so.2 \
/usr/lib/
COPY --from=builder \
/src/musiqlx \
/bin/
VOLUME ["/cache", "/data", "/music", "/podcasts"]
EXPOSE 80
ENV TZ ""
ENV MUSIQLX_DB_PATH /data/musiqlx.db
ENV MUSIQLX_LISTEN_ADDR :80
ENV MUSIQLX_MUSIC_PATH /music
ENV MUSIQLX_PODCAST_PATH /podcasts
ENV MUSIQLX_CACHE_PATH /cache
ENV MUSIQLX_PLAYLISTS_PATH /playlists
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["musiqlx"]