docker-compose.yml 2.81 KB
Newer Older
1
version: "3"
2
3
4
5
6
7

services:
  postgres:
    restart: unless-stopped
    env_file: .env
    image: postgres:9.4
8
9
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
10
11
12
13
14
15

  redis:
    restart: unless-stopped
    env_file: .env
    image: redis:3
    volumes:
16
      - ./data/redis:/data
17
18
19
20
21

  celeryworker:
    restart: unless-stopped
    image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
    env_file: .env
22
23
24
25
26
27
28
29
    # 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
30
    command: celery -A funkwhale_api.taskapp worker -l INFO
31
32
33
34
35
36
    links:
      - postgres
      - redis
    environment:
      - C_FORCE_ROOT=true
    volumes:
37
38
      - "${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_PATH-/music}:ro"
      - "${MEDIA_ROOT}:${MEDIA_ROOT}"
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

  celerybeat:
    restart: unless-stopped
    image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
    env_file: .env
    command: celery -A funkwhale_api.taskapp beat -l INFO
    links:
      - postgres
      - redis

  api:
    restart: unless-stopped
    image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
    env_file: .env
    volumes:
54
55
56
      - "${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_PATH-/music}:ro"
      - "${MEDIA_ROOT}:${MEDIA_ROOT}"
      - "${STATIC_ROOT}:${STATIC_ROOT}"
57
      - "${FUNKWHALE_FRONTEND_PATH}:/frontend"
58
    ports:
59
      - "5000"
60
61
62
    links:
      - postgres
      - redis
63

64
  nginx:
65
    restart: unless-stopped
66
67
68
69
70
    image: nginx
    env_file:
      - .env
    environment:
      # Override those variables in your .env file if needed
71
      - "NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE-100M}"
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    volumes:
      - "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro"
      - "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro"
      - "${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:ro"
      - "${MEDIA_ROOT}:${MEDIA_ROOT}:ro"
      - "${STATIC_ROOT}:${STATIC_ROOT}:ro"
      - "${FUNKWHALE_FRONTEND_PATH}:/frontend:ro"
    ports:
      # override those variables in your .env file if needed
      - "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}: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;'"
    links:
      - api