dev.yml 3.25 KB
Newer Older
1
version: '3'
2 3 4

services:
  front:
Agate's avatar
Agate committed
5
    build: front
6 7 8
    env_file:
      - .env.dev
      - .env
9 10
    environment:
      - "HOST=0.0.0.0"
11
      - "WEBPACK_DEVSERVER_PORT=${WEBPACK_DEVSERVER_PORT-8080}"
12
    ports:
13
      - "${WEBPACK_DEVSERVER_PORT_BINDING-8080:}${WEBPACK_DEVSERVER_PORT-8080}"
14 15
    volumes:
      - './front:/app'
Agate's avatar
Agate committed
16
      - '/app/node_modules'
17
      - './po:/po'
18 19 20 21 22 23 24 25 26
    networks:
      - federation
      - internal
    labels:
      traefik.backend: "${COMPOSE_PROJECT_NAME-node1}"
      traefik.frontend.rule: "Host: ${COMPOSE_PROJECT_NAME-node1}.funkwhale.test"
      traefik.enable: 'true'
      traefik.federation.protocol: 'http'
      traefik.federation.port: "${WEBPACK_DEVSERVER_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 56 57
    links:
     - postgres
     - redis
58
    command: celery -A funkwhale_api.taskapp worker -l debug
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"
69 70
    networks:
      - internal
71
  api:
72 73 74
    env_file:
      - .env.dev
      - .env
75 76
    build:
      context: ./api
Agate's avatar
Agate committed
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"
Agate's avatar
Agate committed
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}"
Agate's avatar
Agate committed
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 101
    environment:
      - "WEBPACK_DEVSERVER_PORT=${WEBPACK_DEVSERVER_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 110
      - ./docker/nginx/entrypoint.sh:/entrypoint.sh:ro
      - ./deploy/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf.template:ro
111 112
      - ./api/funkwhale_api/media:/protected/media
    ports:
113 114 115
      - "6001"
    networks:
      - internal
116 117 118 119 120 121 122 123
  docs:
    build: docs
    command: python serve.py
    volumes:
      - ".:/app/"
    ports:
      - '35730:35730'
      - '8001:8001'
124 125 126 127 128 129

networks:
  internal:
  federation:
    external:
      name: federation