dev.yml 4.41 KB
Newer Older
1
version: "3"
2 3 4

services:
  front:
5
    build: front
6 7 8
    env_file:
      - .env.dev
      - .env
9 10
    environment:
      - "HOST=0.0.0.0"
Eliot Berriot's avatar
Eliot Berriot committed
11
      - "VUE_PORT=${VUE_PORT-8080}"
12
    ports:
13
      - "${VUE_PORT-8080}"
14
    volumes:
15 16 17
      - "./front:/app"
      - "/app/node_modules"
      - "./po:/po"
18 19
    networks:
      - internal
20 21

  postgres:
22 23 24
    env_file:
      - .env.dev
      - .env
25
    image: postgres:${POSTGRES_VERSION-11}
Eliot Berriot's avatar
Eliot Berriot committed
26
    command: postgres -c log_min_duration_statement=0
27 28 29 30
    volumes:
      - "./data/${COMPOSE_PROJECT_NAME-node1}/postgres:/var/lib/postgresql/data"
    networks:
      - internal
31 32

  redis:
33 34 35
    env_file:
      - .env.dev
      - .env
36
    image: redis:3.0
37 38 39 40
    volumes:
      - "./data/${COMPOSE_PROJECT_NAME-node1}/redis:/data"
    networks:
      - internal
41

42
  api:
43 44 45
    env_file:
      - .env.dev
      - .env
46
    build: &backend
47
      context: ./api
48 49 50 51 52 53 54
      dockerfile: Dockerfile
      args:
        install_dev_deps: 1
    entrypoint: compose/django/dev-entrypoint.sh
    command: python /app/manage.py runserver 0.0.0.0:${FUNKWHALE_API_PORT-5000}
    volumes:
      - ./api:/app
55
      - "${MUSIC_DIRECTORY_SERVE_PATH-./data/music}:/music:ro"
56
    environment:
57 58 59 60
      - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
      - "FUNKWHALE_HOSTNAME_SUFFIX=funkwhale.test"
      - "FUNKWHALE_HOSTNAME_PREFIX=${COMPOSE_PROJECT_NAME}"
      - "FUNKWHALE_PROTOCOL=${FUNKWHALE_PROTOCOL-http}"
61 62
      - "DATABASE_URL=postgresql://postgres@postgres/postgres"
      - "CACHE_URL=redis://redis:6379/0"
63

64
    depends_on:
65
      - postgres
66
      # - minio
67
      - redis
68 69
    networks:
      - internal
70 71 72 73
    cap_add:
      - SYS_PTRACE

  celeryworker:
74 75 76
    env_file:
      - .env.dev
      - .env
77
    build: *backend
78
    depends_on:
79
      - postgres
80
      # - minio
81 82
      - redis
    command: celery -A funkwhale_api.taskapp worker -l debug -B
83
    environment:
84 85 86 87
      - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
      - "FUNKWHALE_HOSTNAME_SUFFIX=funkwhale.test"
      - "FUNKWHALE_HOSTNAME_PREFIX=${COMPOSE_PROJECT_NAME}"
      - "FUNKWHALE_PROTOCOL=${FUNKWHALE_PROTOCOL-http}"
88 89
      - "DATABASE_URL=postgresql://postgres@postgres/postgres"
      - "CACHE_URL=redis://redis:6379/0"
90 91
    volumes:
      - ./api:/app
92
      - "${MUSIC_DIRECTORY_SERVE_PATH-./data/music}:/music:ro"
93 94
    networks:
      - internal
95
  nginx:
96
    command: /entrypoint.sh
97 98 99
    env_file:
      - .env.dev
      - .env
100
    image: nginx
101 102
    ports:
      - "${NGINX_PORTS_MAPPING-8000:80}"
103
    environment:
104
      - "NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE-100M}"
105 106 107 108
      - "FUNKWHALE_API_IP=${FUNKHALE_API_IP-api}"
      - "FUNKWHALE_API_PORT=${FUNKWHALE_API_PORT-5000}"
      - "FUNKWHALE_FRONT_IP=${FUNKHALE_FRONT_IP-front}"
      - "FUNKWHALE_FRONT_PORT=${VUE_PORT-8080}"
109 110
      - "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME- }"
      - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
111
    depends_on:
112 113 114
      - api
      - front
    volumes:
115
      - ./docker/nginx/conf.dev:/etc/nginx/nginx.conf.template:ro
116
      - ./docker/nginx/entrypoint.sh:/entrypoint.sh:ro
117
      - "${MUSIC_DIRECTORY_SERVE_PATH-./data/music}:/music:ro"
118 119
      - ./deploy/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro
      - "${MEDIA_ROOT-./api/funkwhale_api/media}:/protected/media:ro"
120
    networks:
121
      - federation
122
      - internal
123 124 125 126 127 128 129 130 131 132

    labels:
      traefik.backend: "${COMPOSE_PROJECT_NAME-node1}"
      traefik.frontend.rule: "Host:${COMPOSE_PROJECT_NAME-node1}.funkwhale.test,${NODE_IP-127.0.0.1}"
      traefik.enable: "true"
      traefik.federation.protocol: "http"
      traefik.federation.port: "80"
      traefik.frontend.passHostHeader: true
      traefik.docker.network: federation

133 134 135 136 137 138
  docs:
    build: docs
    command: python serve.py
    volumes:
      - ".:/app/"
    ports:
139 140
      - "35730:35730"
      - "8001:8001"
141

Eliot Berriot's avatar
Eliot Berriot committed
142
  api-docs:
143
    image: swaggerapi/swagger-ui:v3.21.0
Eliot Berriot's avatar
Eliot Berriot committed
144 145 146
    environment:
      - "API_URL=/swagger.yml"
    ports:
147
      - "8002:8080"
Eliot Berriot's avatar
Eliot Berriot committed
148
    volumes:
149
      - "./docs/swagger.yml:/usr/share/nginx/html/swagger.yml"
Eliot Berriot's avatar
Eliot Berriot committed
150

151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
  # minio:
  #   image: minio/minio
  #   command: server /data
  #   volumes:
  #     - "./data/${COMPOSE_PROJECT_NAME-node1}/minio:/data"
  #   environment:
  #     - "MINIO_ACCESS_KEY=${AWS_ACCESS_KEY_ID-access_key}"
  #     - "MINIO_SECRET_KEY=${AWS_SECRET_ACCESS_KEY-secret_key}"
  #     - "MINIO_HTTP_TRACE: /dev/stdout"
  #   ports:
  #     - "9000:9000"
  #   networks:
  #     - federation
  #     - internal



168
networks:
169
  ? internal
170 171 172
  federation:
    external:
      name: federation