docker-compose.yml 2.48 KB
Newer Older
1
version: '3'
2
services:
3

4
  db:
5
    restart: always
6
    image: postgres:9.6-alpine
7 8
    networks:
      - internal_network
9 10
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
11 12
    volumes:
      - ./postgres:/var/lib/postgresql/data
13

14
  redis:
15
    restart: always
16
    image: redis:5.0-alpine
17 18
    networks:
      - internal_network
19 20
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
21 22
    volumes:
      - ./redis:/data
23

24 25 26 27 28 29 30
#  es:
#    restart: always
#    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.1.3
#    environment:
#      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
#    networks:
#      - internal_network
31 32
#    healthcheck:
#      test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
33 34
#    volumes:
#      - ./elasticsearch:/usr/share/elasticsearch/data
35

36
  web:
Eugen Rochko's avatar
Eugen Rochko committed
37
    build: .
38
    image: tootsuite/mastodon
39
    restart: always
40
    env_file: .env.production
41
    command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
42 43 44
    networks:
      - external_network
      - internal_network
45
    healthcheck:
46
      test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
47
    ports:
48
      - "127.0.0.1:3000:3000"
49 50 51
    depends_on:
      - db
      - redis
52
#      - es
53 54
    volumes:
      - ./public/system:/mastodon/public/system
55

56
  streaming:
57
    build: .
58
    image: tootsuite/mastodon
59 60
    restart: always
    env_file: .env.production
61
    command: node ./streaming
62 63 64
    networks:
      - external_network
      - internal_network
65
    healthcheck:
66
      test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
67
    ports:
68
      - "127.0.0.1:4000:4000"
69 70 71
    depends_on:
      - db
      - redis
72

73
  sidekiq:
74
    build: .
75
    image: tootsuite/mastodon
76
    restart: always
77
    env_file: .env.production
78
    command: bundle exec sidekiq
79 80 81
    depends_on:
      - db
      - redis
82 83 84
    networks:
      - external_network
      - internal_network
85 86
    volumes:
      - ./public/system:/mastodon/public/system
J Yeary's avatar
J Yeary committed
87 88 89 90
## Uncomment to enable federation with tor instances along with adding the following ENV variables
## http_proxy=http://privoxy:8118
## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
#  tor:
91
#    image: sirboops/tor
J Yeary's avatar
J Yeary committed
92 93 94 95 96
#    networks:
#      - external_network
#      - internal_network
#
#  privoxy:
97
#    image: sirboops/privoxy
J Yeary's avatar
J Yeary committed
98 99 100 101 102
#    volumes:
#      - ./priv-config:/opt/config
#    networks:
#      - external_network
#      - internal_network
103 104 105 106 107

networks:
  external_network:
  internal_network:
    internal: true