/
Dockerfile
101 lines (90 loc) · 2.27 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
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
FROM alpine:3.8
MAINTAINER thetarkus
#
# Installation
#
ARG arch=amd64
RUN \
echo 'installing dependencies' && \
apk add \
shadow \
gettext \
git \
postgresql \
postgresql-contrib \
postgresql-dev \
python3-dev \
py3-psycopg2 \
py3-pillow \
redis \
nginx \
musl-dev \
gcc \
unzip \
libldap \
libsasl \
ffmpeg \
libpq \
libmagic \
libffi-dev \
zlib-dev \
openldap-dev && \
\
\
echo 'creating directories' && \
mkdir -p /app /run/nginx /run/postgresql /var/log/funkwhale && \
\
\
echo 'creating users' && \
adduser -s /bin/false -D -H funkwhale funkwhale && \
\
\
echo 'downloading archives' && \
wget https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-$arch.tar.gz -O /tmp/s6-overlay.tar.gz && \
\
\
echo 'extracting archives' && \
cd /app && \
tar -C / -xzf /tmp/s6-overlay.tar.gz && \
\
\
echo 'setting up nginx' && \
rm /etc/nginx/conf.d/default.conf && \
\
\
echo 'removing temp files' && \
rm /tmp/*.tar.gz
COPY ./src/api /app/api
RUN \
ln -s /usr/bin/python3 /usr/bin/python && \
echo 'fixing requirements file for alpine' && \
sed -i '/Pillow/d' /app/api/requirements/base.txt && \
\
\
echo 'installing pip requirements' && \
pip3 install --upgrade pip && \
pip3 install setuptools wheel && \
pip3 install -r /app/api/requirements.txt
COPY ./src/front /app/front
#
# Environment
# https://dev.funkwhale.audio/funkwhale/funkwhale/blob/develop/deploy/env.prod.sample
# (Environment is at the end to avoid busting build cache on each ENV change)
#
ENV FUNKWHALE_HOSTNAME=yourdomain.funkwhale \
FUNKWHALE_PROTOCOL=http \
DJANGO_SETTINGS_MODULE=config.settings.production \
DJANGO_SECRET_KEY=funkwhale \
DJANGO_ALLOWED_HOSTS='127.0.0.1,*' \
DATABASE_URL=postgresql://funkwhale@:5432/funkwhale \
MEDIA_ROOT=/data/media \
MUSIC_DIRECTORY_PATH=/music \
NGINX_MAX_BODY_SIZE=100M \
STATIC_ROOT=/app/api/staticfiles \
FUNKWHALE_SPA_HTML_ROOT=http://localhost/front/
#
# Entrypoint
#
COPY ./root /
COPY ./src/funkwhale_nginx.template /etc/nginx/funkwhale_nginx.template
ENTRYPOINT ["/init"]