GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

docker-compose.yml 4.34 KB
Newer Older
1 2
# Main docker-compose
# Suited for containerized SSR server.
3 4 5
version: "2.2"

services:
6

7
  ## WEB SERVER / GATEWAY
8

9 10 11 12 13 14 15
  nginx:
    build:
      context: ./containers/nginx
      dockerfile: ./Dockerfile.dev-ssr
    mem_limit: 512MB
    depends_on:
      - php-fpm
16 17
    networks:
      - app
18
    ports:
19
      - "8080:80"
20
    environment:
21
      - UPSTREAM_ENDPOINT
22
    volumes:
23
      - ./front/:/var/www/Minds/front:cached
24

25
  ## APP ENGINE
26 27 28 29

  php-fpm:
    build:
      context: ./engine
30 31
      dockerfile: ./containers/php-fpm/Dockerfile.dev
    mem_limit: 512MB
32 33
    depends_on:
      - cassandra
34 35
      - mongo
      - elasticsearch
36
      - rabbitmq
37 38 39 40
      - redis
    networks:
      - app
    volumes:
41 42
      - ./front/:/var/www/Minds/front:cached
      - ./engine/:/var/www/Minds/engine:cached
43
      - keys:/.dev
44 45 46 47

  runners:
    build:
      context: ./engine
48
      dockerfile: ./containers/php-runners/Dockerfile
49 50
    depends_on:
      - cassandra
51 52
      - elasticsearch
      - rabbitmq
53 54 55 56
      - redis
    networks:
      - app
    volumes:
57 58 59
      - ./front/:/var/www/Minds/front:cached
      - ./engine/:/var/www/Minds/engine:cached
      - keys:/.dev
60

61 62 63 64 65 66 67 68 69
  sockets:
    image: minds/sockets
    environment:
      - PORT=3030
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - JWT_SECRET=<!!! set this to jwt-token in your engine/settings.php !!!>
      - CASSANDRA_SERVERS=cassandra
      - CASSANDRA_KEYSPACE=minds
70 71
    networks:
      - app
72
    depends_on:
73 74
      - redis
      - cassandra
75
    ports:
76 77 78 79 80 81 82 83 84 85
      - 8010:3030

  ## DATABASES

  cassandra:
    image: cassandra:3.11.1
    environment:
      - CASSANDRA_START_RPC=true
      - MAX_HEAP_SIZE=768M
      - HEAP_NEWSIZE=512M
86
    networks:
87 88
      - app
    mem_limit: 1024MB
89
    volumes:
90 91 92 93 94 95
      - cassandra-data:/var/lib/cassandra
    healthcheck:
      test: "cqlsh -e 'DESC TABLE system.batches'"
      retries: 10
      timeout: 5s
      interval: 15s
96

97 98
  mongo:
    image: mongo:3.4
99 100
    networks:
      - app
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119

  elasticsearch:
    image: elasticsearch:6.6.2
    entrypoint: /set-permissions-and-start.sh
    mem_limit: 512MB # keep an eye
    ulimits:
      nproc: 65536
      memlock:
        soft: 65536
        hard: 65536
      nofile:
        soft: 65536
        hard: 65536
    environment:
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    networks:
      - app
    ports:
      - "9200:9200"
120
    volumes:
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
      - ./containers/elasticsearch/set-permissions-and-start.sh:/set-permissions-and-start.sh:cached
      - elasticsearch-data:/usr/share/elasticsearch/data

  ## CACHE

  redis:
    image: redis:4.0-alpine
    mem_limit: 100MB # keep an eye
    networks:
      - app

  ## QUEUE

  rabbitmq:
    image: rabbitmq:3.6-alpine
    networks:
      - app

  ## INSTALLATION ARTIFACTS
140

Mark Harding's avatar
Mark Harding committed
141 142 143 144
  installer:
    build:
      context: ./engine
      dockerfile: ./containers/installer/Dockerfile
Mark Harding's avatar
Mark Harding committed
145 146
    networks:
      - app
Mark Harding's avatar
Mark Harding committed
147
    volumes:
148 149 150
      - ./front/:/var/www/Minds/front:delegated
      - ./engine/:/var/www/Minds/engine:delegated
      - keys:/.dev
151 152 153
    depends_on:
      cassandra:
        condition: service_healthy
Mark Harding's avatar
Mark Harding committed
154

155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
  elasticsearch-legacy:
    image: elasticsearch:5.6-alpine
    entrypoint: /clear-data-and-start.sh
    environment:
      - "xpack.security.enabled=false"
      - "http.host=0.0.0.0"
      - "transport.host=127.0.0.1"
    networks:
      - app
    ports:
      - "9200:9200"
    volumes:
      - ./containers/elasticsearch-legacy/clear-data-and-start.sh:/clear-data-and-start.sh:cached
      - elasticsearch-data:/usr/share/elasticsearch/data

170 171
  elasticsearch-legacy-provisioner:
    build:
172
      context: ./containers/elasticsearch-provisioner
173
    entrypoint: sh /provisioner/provision-elasticsearch-legacy.sh elasticsearch-legacy
174 175 176 177 178 179
    networks:
      - app
    depends_on:
      - elasticsearch-legacy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
Ben Hayward's avatar
Ben Hayward committed
180
      - ./engine/Core/Provisioner/Provisioners/ElasticSearchIndices/minds_badger.json:/minds_badger.json
181 182 183

  elasticsearch-provisioner:
    build:
184
      context: ./containers/elasticsearch-provisioner
185 186 187 188 189
    networks:
      - app
    depends_on:
      - elasticsearch

190 191 192 193 194 195
  ## UTILITIES

  kibana:
    image: docker.elastic.co/kibana/kibana-oss:6.6.2
    depends_on:
      - elasticsearch
196
    environment:
197
      ELASTICSEARCH_URL: http://minds_elasticsearch_1:9200
198 199 200
    networks:
      - app
    ports:
201
      - "5601:5601"
202

203 204 205 206 207
volumes:
  cassandra-data:
  elasticsearch-data:
  keys:

208 209 210
networks:
  app:
    driver: "bridge"