-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
117 lines (99 loc) · 4.65 KB
/
Copy pathDockerfile
File metadata and controls
117 lines (99 loc) · 4.65 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 2025 André Silva
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM aandree5/gui-web-base:v1.11.0 AS minimal
LABEL org.opencontainers.image.authors="Aandree5" \
org.opencontainers.image.license="Apache-2.0" \
org.opencontainers.image.url="https://github.com/Aandree5/picard-web" \
org.opencontainers.image.title="Picard Web" \
org.opencontainers.image.description="Image to run MusicBrainz Picard in the browser"
# Directories for upstream image to set the correct permissions
# `pw` for image required scripts and files
# `picard-web` for user to persist
ENV APP_DIRS="/pw /picard-web"
EXPOSE 5000
EXPOSE 5443
# Picard browser integration
EXPOSE 8000
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
picard \
&& apt-get install -y --no-install-recommends \
xfe \
adwaita-qt \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /picard-web/MusicBrainz \
&& mkdir -p "${GWB_HOME}/.config" \
&& chown -R "${PUID}:${PGID}" "${GWB_HOME}/.config" \
# Link picard config files so that source of truth is /picard-web/MusicBrainz
&& ln -sfn /picard-web/MusicBrainz "${GWB_HOME}/.config/MusicBrainz" \
# When loading new configuration (from options > maintenance),
# picard will take a backup of the current configuration and try
# to save it to /home/gwb/Documents, create a link for persistence
&& mkdir /picard-web/backups \
&& ln -sfn /picard-web/backups "${GWB_HOME}/Documents"
# Clean xfe application menu entries
RUN sed -i "s/^Name=.*/Name=File Manager/" /usr/share/applications/xfe.desktop \
&& sed -i "s/^Name=.*/Name=Image Viewer/" /usr/share/applications/xfi.desktop \
&& sed -i "/^Exec=/a NoDisplay=true" /usr/share/applications/xfw.desktop \
&& sed -i "/^Exec=/a NoDisplay=true" /usr/share/applications/xfp.desktop \
&& sed -i "/^Exec=/a NoDisplay=true" /usr/share/applications/xfa.desktop
# Overriding entrypoint
COPY scripts/entrypoint.sh /pw/entrypoint.sh
RUN chmod +x /pw/entrypoint.sh
RUN configure-xpra --content-type class-instance:Picard=text
# TEMP - Dark theme for picard. v3 will handle dark theme differently and this will be removed
ENV QT_STYLE_OVERRIDE=Adwaita-Dark
# Container healthcheck
COPY scripts/healthcheck.sh /pw/healthcheck.sh
RUN chmod +x /pw/healthcheck.sh
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD /pw/healthcheck.sh
ENTRYPOINT [ "/pw/entrypoint.sh" ]
CMD ["start-app", "--title", "Picard Web", "picard"]
FROM minimal AS full
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
rsgain \
git \
zip \
fonts-noto-cjk \
&& fc-cache -f -v
RUN mkdir -p /picard-web/MusicBrainz/Picard/plugins \
# Install official plugin (https://github.com/metabrainz/picard-plugins)
&& git clone https://github.com/metabrainz/picard-plugins /tmp/picard-plugins \
&& (cd /tmp/picard-plugins/plugins && zip -r /picard-web/MusicBrainz/Picard/plugins/replaygain2.zip replaygain2) \
&& (cd /tmp/picard-plugins/plugins && zip -r /picard-web/MusicBrainz/Picard/plugins/acousticbrainz.zip acousticbrainz) \
&& rm -rf /tmp/picard-plugins \
# Install lyrics plugin (https://github.com/izaz4141/picard-lrclib)
&& git clone https://github.com/izaz4141/picard-lrclib /tmp/lrclib \
&& mv /tmp/lrclib/lrcget.py /tmp/lrclib/__init__.py \
&& (cd /tmp && zip -r /picard-web/MusicBrainz/Picard/plugins/lrclib.zip lrclib -x "lrclib/.git" "lrclib/readme") \
&& rm -rf /tmp/lrclib \
# Enable plugins
&& echo "[setting]\nenabled_plugins=lrclib, replaygain2, acousticbrainz" > "/picard-web/MusicBrainz/Picard.ini"
# Set permissions
RUN chown -R "${PUID}:${PGID}" /picard-web \
# Backup initial config so to be restored in case a bind is created on picard-web folder,
# as binding to a host dir will always take the host as the source and thus clear picard-web folder,
# entrypoint can then restore if needed
&& mkdir /pw/initial \
&& cp -a /picard-web/. /pw/initial/
RUN apt-get remove -y \
git \
zip \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*