dev.yml 3.42 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
33 34 35 36
    volumes:
      - "./data/${COMPOSE_PROJECT_NAME-node1}/postgres:/var/lib/postgresql/data"
    networks:
      - internal
37 38

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

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

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

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