dev/docker-compose.yml
author ymh <ymh.work@gmail.com>
Thu, 15 Mar 2018 23:52:11 +0100
changeset 686 385e3a12ee27
child 687 53fee689f666
permissions -rw-r--r--
Containerization and various corrections to make it work
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
version: '3'
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
services:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
  # postgres
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  pg:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    image: postgres:alpine
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    environment:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
      POSTGRES_USER: iri
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
      POSTGRES_PASSWORD: iri
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
      POSTGRES_DB: hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    ports:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
      - '5432:5432'
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    volumes:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
      - pg-data:/var/lib/postgresql/data
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
  # nginx (webserver)
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
  front:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    build:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
      context: ./front
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    ports:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
      - '8080:80'
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    depends_on:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
      - "hdalab"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
    volumes:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
      - static-content:/var/lib/hdalab/static
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
      - front-data:/usr/share/nginx/html
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
      - front-logs:/var/log/nginx
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
  # Elasticsearch
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
  es:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.8
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    environment:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
      - "discovery.type=single-node"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
      - "cluster.name=docker-cluster"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
      - "xpack.security.enabled=false"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    volumes:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
      - es-data:/usr/share/elasticsearch/data
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
  # mailhog
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
  mail:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
    image: mailhog/mailhog
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
    ports:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
      - "8025:8025"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
  # rabbitmq
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
  rabbitmq:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
    hostname: hdalab-rabbitmq
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
    image: rabbitmq:alpine
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
    environment:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
      RABBITMQ_DEFAULT_VHOST: hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
  # hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
  hdalab:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
    build: ./hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
    volumes:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
      - static-content:/var/lib/hdalab/static
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
      - hdalab-logs:/var/log/hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
    depends_on:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
      - "pg"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
      - "es"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
      - "mail"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
      - "rabbitmq"
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
volumes:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
  static-content:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
  hdalab-logs:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
  pg-data:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
  front-data:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
  front-logs:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
  es-data:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68