-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
24 lines (23 loc) · 1.05 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
# docker run -it --rm -p 65535:65535/tcp -v ~/Music:/data -v ~/.cache:/cache ghcr.io/streambinder/spotitube
FROM golang:alpine AS builder
WORKDIR /workspace
COPY . .
RUN --mount=type=secret,id=SPOTIFY_ID \
--mount=type=secret,id=SPOTIFY_KEY \
--mount=type=secret,id=GENIUS_TOKEN \
go mod download && \
go build -ldflags="-s -w -X github.com/streambinder/spotitube/spotify.fallbackSpotifyID=$(cat /run/secrets/SPOTIFY_ID) -X github.com/streambinder/spotitube/spotify.fallbackSpotifyKey=$(cat /run/secrets/SPOTIFY_KEY) -X github.com/streambinder/spotitube/lyrics.fallbackGeniusToken=$(cat /run/secrets/GENIUS_TOKEN)"
FROM alpine:3
RUN apk add --no-cache ffmpeg yt-dlp && \
mkdir /data && \
mkdir /cache && \
adduser -S spotitube
USER spotitube
WORKDIR /data
ENV XDG_MUSIC_DIR=/data
ENV XDG_CACHE_HOME=/cache
COPY --from=builder /workspace/spotitube /usr/sbin/
HEALTHCHECK CMD [ "/usr/sbin/spotitube", "--help" ]
EXPOSE 65535/tcp
ENTRYPOINT ["/usr/sbin/spotitube"]
LABEL org.opencontainers.image.source=https://github.com/streambinder/spotitube