This repository has been archived by the owner on Jul 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
141 lines (134 loc) · 3.86 KB
/
docker-compose.yml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "3"
services:
postgres:
container_name: 'muzikoj_postgres'
hostname: 'muzikoj_postgres'
restart: always
networks:
- default
env_file: .env
environment:
- 'POSTGRES_USER=funkwhale'
- 'POSTGRES_PASSWORD=funkwhale'
- 'POSTGRES_DB=funkwhale'
- 'POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C'
- 'TZ=Asia/Tokyo'
- 'PGTZ=Asia/Tokyo'
- 'POSTGRES_HOST_AUTH_METHOD=trust'
image: postgres:alpine
volumes:
- ./var/postgres:/var/lib/postgresql/data
networks:
- 'muzikoj-link'
redis:
container_name: 'muzikoj_redis'
hostname: 'muzikoj_redis'
restart: always
networks:
- default
env_file: .env
image: redis:5
volumes:
- ./var/redis:/data
networks:
- 'muzikoj-link'
celeryworker:
container_name: 'muzikoj_celeryworker'
hostname: 'muzikoj_celeryworker'
restart: always
image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
networks:
- default
depends_on:
- postgres
- redis
env_file: .env
# Celery workers handle background tasks (such file imports or federation
# messaging). The more processes a worker gets, the more tasks
# can be processed in parallel. However, more processes also means
# a bigger memory footprint.
# By default, a worker will span a number of process equal to your number
# of CPUs. You can adjust this, by explicitly setting the --concurrency
# flag:
# celery -A funkwhale_api.taskapp worker -l INFO --concurrency=4
command: celery -A funkwhale_api.taskapp worker -l INFO --concurrency=${CELERYD_CONCURRENCY-0}
environment:
- C_FORCE_ROOT=true
volumes:
- "./var/funkwhale/music:${MUSIC_DIRECTORY_PATH-/music}:ro"
- "./var/funkwhale/media:${MEDIA_ROOT}"
networks:
- 'muzikoj-link'
celerybeat:
container_name: 'muzikoj_celerybeat'
hostname: 'muzikoj_celerybeat'
restart: always
image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
networks:
- default
depends_on:
- postgres
- redis
env_file: .env
command: celery -A funkwhale_api.taskapp beat --pidfile= -l INFO
networks:
- 'muzikoj-link'
api:
container_name: 'muzikoj_api'
hostname: 'muzikoj_api'
restart: always
image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
networks:
- default
depends_on:
- postgres
- redis
env_file: .env
volumes:
- "./var/funkwhale/music:${MUSIC_DIRECTORY_PATH-/music}:ro"
- "./var/funkwhale/media:${MEDIA_ROOT}"
- "./var/funkwhale/static:${STATIC_ROOT}"
- "./var/funkwhale/frontend:/frontend"
networks:
- 'muzikoj-link'
ports:
- "5000"
nginx:
container_name: 'muzikoj_nginx'
hostname: 'muzikoj_nginx'
restart: always
image: nginx
networks:
- default
depends_on:
- api
env_file:
- .env
environment:
# Override those variables in your .env file if needed
- "NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE-100M}"
volumes:
- "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro"
- "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro"
- "./var/funkwhale/music:${MUSIC_DIRECTORY_PATH-/music}:ro"
- "./var/funkwhale/media:${MEDIA_ROOT}:ro"
- "./var/funkwhale/static:${STATIC_ROOT}:ro"
- "./var/funkwhale/frontend:/frontend:ro"
networks:
- 'muzikoj-link'
- 'planet-link'
expose:
- '80'
command: >
sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\"
< /etc/nginx/conf.d/funkwhale.template
> /etc/nginx/conf.d/default.conf
&& cat /etc/nginx/conf.d/default.conf
&& nginx -g 'daemon off;'"
networks:
default:
driver: 'null'
muzikoj-link:
external: false
planet-link:
external: true