dev.yml 3.47 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 13
    ports:
      - "${VUE_PORT-8080}:${VUE_PORT-8080}"
14
    volumes:
15 16 17
      - "./front:/app"
      - "/app/node_modules"
      - "./po:/po"
18 19 20 21 22
    networks:
      - federation
      - internal
    labels:
      traefik.backend: "${COMPOSE_PROJECT_NAME-node1}"
23
      traefik.frontend.rule: "Host:${COMPOSE_PROJECT_NAME-node1}.funkwhale.test,${NODE_IP-127.0.0.1}"
24 25 26
      traefik.enable: "true"
      traefik.federation.protocol: "http"
      traefik.federation.port: "${VUE_PORT-8080}"
27 28

  postgres:
29 30 31
    env_file:
      - .env.dev
      - .env
32
    image: postgres
Eliot Berriot's avatar
Eliot Berriot committed
33
    command: postgres -c log_min_duration_statement=0
34 35 36 37
    volumes:
      - "./data/${COMPOSE_PROJECT_NAME-node1}/postgres:/var/lib/postgresql/data"
    networks:
      - internal
38 39

  redis:
40 41 42
    env_file:
      - .env.dev
      - .env
43
    image: redis:3.0
44 45 46 47
    volumes:
      - "./data/${COMPOSE_PROJECT_NAME-node1}/redis:/data"
    networks:
      - internal
48 49

  celeryworker:
50 51 52
    env_file:
      - .env.dev
      - .env
53 54
    build:
      context: ./api
55
      dockerfile: docker/Dockerfile.test
56
    links:
57 58
      - postgres
      - redis
59
    command: celery -A funkwhale_api.taskapp worker -l debug -B
60
    environment:
61 62 63 64
      - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
      - "FUNKWHALE_HOSTNAME_SUFFIX=funkwhale.test"
      - "FUNKWHALE_HOSTNAME_PREFIX=${COMPOSE_PROJECT_NAME}"
      - "FUNKWHALE_PROTOCOL=${FUNKWHALE_PROTOCOL-http}"
65 66
      - "DATABASE_URL=postgresql://postgres@postgres/postgres"
      - "CACHE_URL=redis://redis:6379/0"
67 68
    volumes:
      - ./api:/app
69
      - "${MUSIC_DIRECTORY-./data/music}:/music:ro"
70 71
    networks:
      - internal
72
  api:
73 74 75
    env_file:
      - .env.dev
      - .env
76 77
    build:
      context: ./api
78
      dockerfile: docker/Dockerfile.test
79 80 81
    command: python /app/manage.py runserver 0.0.0.0:12081
    volumes:
      - ./api:/app
82
      - "${MUSIC_DIRECTORY-./data/music}:/music:ro"
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 92
    links:
      - postgres
      - redis
93 94
    networks:
      - internal
95
  nginx:
96
    command: /entrypoint.sh
97 98 99
    env_file:
      - .env.dev
      - .env
100
    image: nginx
101
    environment:
102
      - "VUE_PORT=${VUE_PORT-8080}"
103 104
      - "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME- }"
      - "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-localhost}"
105 106 107 108 109
    links:
      - api
      - front
    volumes:
      - ./docker/nginx/conf.dev:/etc/nginx/nginx.conf
110
      - ./docker/nginx/entrypoint.sh:/entrypoint.sh:ro
111
      - "${MUSIC_DIRECTORY-./data/music}:/music:ro"
112
      - ./deploy/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf.template:ro
113 114
      - ./api/funkwhale_api/media:/protected/media
    ports:
115 116 117
      - "6001"
    networks:
      - internal
118 119 120 121 122 123
  docs:
    build: docs
    command: python serve.py
    volumes:
      - ".:/app/"
    ports:
124 125
      - "35730:35730"
      - "8001:8001"
126

Eliot Berriot's avatar
Eliot Berriot committed
127 128 129 130 131
  api-docs:
    image: swaggerapi/swagger-ui
    environment:
      - "API_URL=/swagger.yml"
    ports:
132
      - "8002:8080"
Eliot Berriot's avatar
Eliot Berriot committed
133
    volumes:
134
      - "./docs/swagger.yml:/usr/share/nginx/html/swagger.yml"
Eliot Berriot's avatar
Eliot Berriot committed
135

136
networks:
137
  ? internal
138 139 140
  federation:
    external:
      name: federation