summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: a5d3d57b1a4a967e8013abf2b2088410ba2e2e3f (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
version: '2'
services:
  haproxy:
    image: haproxy:latest
    volumes:
      - ./config/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
      - ./config/server.pem:/usr/local/etc/haproxy/server.pem
    links:
      - www1
      - www2
    ports:
      - "80:80"
      - "443:443"
  www1:
    image: nginx:latest
    volumes:
      - ./config/nginx.conf:/etc/nginx/nginx.conf
      - ./public:/var/www/public
      - ./config/server.crt:/etc/nginx/server.crt
      - ./config/server.key:/etc/nginx/server.key
    links:
      - web
  www2:
    image: nginx:latest
    volumes:
      - ./config/nginx.conf:/etc/nginx/nginx.conf
      - ./public:/var/www/public
      - ./config/server.crt:/etc/nginx/server.crt
      - ./config/server.key:/etc/nginx/server.key
    links:
      - web
  web:
    build: .
    command: bundle exec foreman start web
    volumes:
      - .:/app
    links:
      - redis
      - db
    depends_on:
      - redis
      - db
    environment:
      - REDIS_URL=redis://redis:6379/12
      - RAILS_LOG_TO_STDOUT=true
  worker:
    build: .
    command: bundle exec sidekiq
    volumes:
      - .:/app
    links:
      - redis
      - db
    depends_on:
      - redis
      - db
    environment:
      REDIS_URL: 'redis://redis:6379/12'
  db:
    image: postgres:latest
    ports:
      - "5432:5432"
    volumes:
      - ./db/data:/var/lib/postgresql/data
  redis:
    image: redis:latest
    ports:
      - "6379:6379"