This repository has been archived by the owner on Feb 24, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile.armhf
127 lines (121 loc) · 3.2 KB
/
Dockerfile.armhf
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
118
119
120
121
122
123
124
125
126
127
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.12
# set version label
ARG BUILD_DATE
ARG VERSION
ARG MUSICBRAINZ_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
# copy files required in build stage
COPY prebuilds/ /defaults/
# global environment settings
ENV BABEL_DISABLE_CACHE="1" \
HOME="/root" \
LANG="en_US.utf8" \
MBDATA="/data/import" \
PGCONF="/config" \
PGDATA="/data/dbase" \
UPDATE_SLAVE_LOGDIR="/config/log/musicbrainz" \
URL_ROOT="http://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies --upgrade \
db-dev \
expat-dev \
g++ \
gcc \
git \
icu-dev \
libxml2-dev \
make \
perl-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
bzip2 \
curl \
db \
expat \
gettext \
git \
icu-libs \
nginx \
nodejs-current \
patch \
logrotate \
perl \
perl-crypt-rijndael \
perl-dbd-pg \
perl-db_file \
perl-net-ssleay \
postgresql \
postgresql-contrib \
postgresql-dev \
procps \
redis \
tar \
wget \
yarn && \
echo "**** fetch musicbrainz and install perl and node packages ****" && \
if [ -z ${MUSICBRAINZ_RELEASE+x} ]; then \
MUSICBRAINZ_RELEASE=$(git ls-remote --tags https://github.com/metabrainz/musicbrainz-server.git \
| grep -v '{}' \
| tail -n 1 \
| awk -F / '{print $3}'); \
fi && \
mkdir -p \
/app/musicbrainz && \
curl -o \
/tmp/musicbrainz.tar.gz -L \
"https://github.com/metabrainz/musicbrainz-server/archive/${MUSICBRAINZ_RELEASE}.tar.gz" && \
tar xf \
/tmp/musicbrainz.tar.gz -C \
/app/musicbrainz --strip-components=1 && \
sed -i 's#$MB_SERVER_ROOT/#$UPDATE_SLAVE_LOGDIR/#g' /app/musicbrainz/admin/cron/slave.sh && \
cp /defaults/DBDefs.pm /app/musicbrainz/lib/DBDefs.pm && \
cd /app/musicbrainz && \
curl -L http://cpanmin.us | perl - App::cpanminus && \
sed -i '/Test::Magpie/d' cpanfile && \
cpanm --installdeps --notest . && \
cpanm --notest \
Cache::Memcached::Fast \
Cache::Memory \
Catalyst::Plugin::Cache::HTTP \
Catalyst::Plugin::StackTrace \
Digest::MD5::File \
DynaLoader::Functions \
FCGI \
FCGI::ProcManager \
Plack::Handler::Starlet \
Plack::Middleware::Debug::Base \
Server::Starter \
Starlet \
Starlet::Server \
Term::Size::Any && \
yarn install && \
yarn cache clean && \
./script/compile_resources.sh && \
echo "**** compile musicbrainz postgresql addons ****" && \
git clone git://github.com/metabrainz/postgresql-musicbrainz-unaccent \
/tmp/postgresql-musicbrainz-unaccent && \
cd /tmp/postgresql-musicbrainz-unaccent && \
make && \
make install && \
git clone git://github.com/metabrainz/postgresql-musicbrainz-collate.git \
/tmp/postgresql-musicbrainz-collate && \
cd /tmp/postgresql-musicbrainz-collate && \
make && \
make install && \
echo "**** configure nginx ****" && \
echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> \
/etc/nginx/fastcgi_params && \
rm -f /etc/nginx/conf.d/default.conf && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cpanm \
/tmp/*
# add local files
COPY root/ /
# volumes and ports
VOLUME /config /data
EXPOSE 5000