kontena-testing-smoke-cert.yml 2.87 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
stack: coodari/article-project
version: 1.0.0
description: Article project testing environment smoke stack with certs

variables:
  front_service_version:
    type: string
    from:
      vault: FRONT_SERVICE_VERSION
  app_service_version:
    type: string
    from:
      vault: APP_SERVICE_VERSION
  auth_service_version:
    type: string
    from:
      vault: AUTH_SERVICE_VERSION

services:
  load-balancer-proxy:
    image: kontena/lb:latest
    ports:
      - 443:443
      - 80:80
    secrets:
      - secret: SSL_LOAD_BALANCER_CERT_BUNDLE
        name: SSL_CERTS
        type: env

  front-service:
    image: "articleprojects/front-service:${front_service_version}"
    environment:
      - KONTENA_LB_MODE=http
      - KONTENA_LB_BALANCE=roundrobin
      - KONTENA_LB_INTERNAL_PORT=3300
      - KONTENA_LB_CUSTOM_SETTINGS=redirect scheme https code 301 if !{ ssl_fc }
    links:
      - load-balancer-proxy
    depends_on:
      - app-service
41 42 43 44 45
      - auth-service
    secrets:
      - secret: FRONT_SERVICE_DOMAIN
        name: KONTENA_LB_VIRTUAL_HOSTS
        type: env
46 47 48 49 50 51 52 53 54 55 56 57 58

  app-service:
    image: "articleprojects/app-service:${app_service_version}"
    environment:
      - NODE_ENV=production
      - KONTENA_LB_MODE=http
      - KONTENA_LB_BALANCE=roundrobin
      - KONTENA_LB_INTERNAL_PORT=3000
      - KONTENA_LB_CUSTOM_SETTINGS=redirect scheme https code 301 if !{ ssl_fc }
    links:
      - load-balancer-proxy
    depends_on:
      - db-app
59 60 61 62
    secrets:
      - secret: APP_SERVICE_DOMAIN
        name: KONTENA_LB_VIRTUAL_HOSTS
        type: env
63 64 65 66 67 68 69 70 71 72 73 74 75

  auth-service:
    image: "articleprojects/auth-service:${auth_service_version}"
    environment:
      - NODE_ENV=production
      - KONTENA_LB_MODE=http
      - KONTENA_LB_BALANCE=roundrobin
      - KONTENA_LB_INTERNAL_PORT=3100
      - KONTENA_LB_CUSTOM_SETTINGS=redirect scheme https code 301 if !{ ssl_fc }
    links:
      - load-balancer-proxy
    depends_on:
      - db-auth
76 77 78 79
    secrets:
      - secret: AUTH_SERVICE_DOMAIN
        name: KONTENA_LB_VIRTUAL_HOSTS
        type: env
80 81 82 83 84 85

  db-app:
    image: postgres:9.6.2
    stateful: true
    volumes:
      - db_volume_app:/var/lib/postgresql/data
86 87 88 89 90 91 92 93 94 95
    secrets:
      - secret: APP_POSTGRES_USER
        name: POSTGRES_USER
        type: env
      - secret: APP_POSTGRES_PASSWORD
        name: POSTGRES_PASSWORD
        type: env
      - secret: APP_POSTGRES_DB
        name: POSTGRES_DB
        type: env
96 97 98 99 100 101

  db-auth:
    image: postgres:9.6.2
    stateful: true
    volumes:
      - db_valume_auth:/var/lib/postgresql/data
102 103 104 105 106 107 108 109 110 111
    secrets:
      - secret: AUTH_POSTGRES_USER
        name: POSTGRES_USER
        type: env
      - secret: AUTH_POSTGRES_PASSWORD
        name: POSTGRES_PASSWORD
        type: env
      - secret: AUTH_POSTGRES_DB
        name: POSTGRES_DB
        type: env
112 113 114 115 116 117 118 119

volumes:
  db_volume_app:
    external:
      name: db-volume-app
  db_valume_auth:
    external:
      name: db-volume-auth