summaryrefslogtreecommitdiff
path: root/playbooks/roles/ci/templates/stacks/docker-compose.yml
blob: 2a77205d76437c00882e155de404ef2cd9a2cc91 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---

services:
  worker:
    image: oci.liz.coffee/emprespresso/ci_worker:release
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - {{ ci_base }}/volumes/laminar:/var/lib/laminar/
      - /var/lib/laminar/cfg # don't overwrite cfg jobs & scripts
    healthcheck:
      test: ["CMD-SHELL", "/usr/bin/laminarc show-jobs"]
      timeout: 15s
      interval: 10s
      retries: 3
      start_period: 5s
    environment:
      - TZ={{ timezone }}
      - DEPLOYMENT_TIME={{ deployment_time }}
      - BW_SERVER=https://{{ passwd_domain }}
      - BW_CLIENTID={{ passwd_client_id }}
      - BW_CLIENTSECRET={{ passwd_client_secret }}
      - BW_PASSWORD={{ passwd_master_password }}
      - LAMINAR_BIND_RPC=*:9997
      - LAMINAR_ARCHIVE_URL=https://{{ ci_domain }}
      - LAMINAR_KEEP_RUNDIRS=5
    networks:
      - ci
      - proxy
    deploy:
      mode: replicated
      update_config:
        parallelism: 1
        failure_action: rollback
        order: start-first
        delay: 5s
        monitor: 20s
      replicas: 1
      labels:
        - traefik.enable=true
        - traefik.swarm.network=proxy
        - traefik.http.routers.ci.tls=true
        - traefik.http.routers.ci.tls.certResolver=letsencrypt
        - traefik.http.routers.ci.rule=Host(`{{ ci_domain }}`)
        - traefik.http.routers.ci.middlewares=oauth-verify
        - traefik.http.routers.ci.entrypoints=websecure
        - traefik.http.services.ci.loadbalancer.server.port=8080

  server:
    image: oci.liz.coffee/emprespresso/ci_server:release
    environment:
      - LAMINAR_HOST=worker:9997
      - LAMINAR_URL=https://{{ ci_domain }}
      - TZ={{ timezone }}
      - DEPLOYMENT_TIME={{ deployment_time }}
    healthcheck:
      test: ["CMD-SHELL", "curl --fail http://localhost:9000/health"]
      timeout: 15s
      interval: 10s
      retries: 3
      start_period: 5s
    networks:
      - ci
    deploy:
      mode: replicated
      update_config:
        parallelism: 1
        failure_action: rollback
        order: start-first
        delay: 5s
        monitor: 10s

networks:
  ci:
    driver: overlay
    attachable: true
    name: ci
  proxy:
    external: true