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

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

15
  redis:
16
    restart: always
Shlee's avatar
Shlee committed
17
    image: redis:6.0-alpine
18 19
    networks:
      - internal_network
20 21
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
22 23
    volumes:
      - ./redis:/data
24

25 26
#  es:
#    restart: always
27
#    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.10
28 29
#    environment:
#      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
30 31 32
#      - "cluster.name=es-mastodon"
#      - "discovery.type=single-node"
#      - "bootstrap.memory_lock=true"
33 34
#    networks:
#      - internal_network
35 36
#    healthcheck:
#      test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
37 38
#    volumes:
#      - ./elasticsearch:/usr/share/elasticsearch/data
39 40 41 42
#    ulimits:
#      memlock:
#        soft: -1
#        hard: -1
43

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

64
  streaming:
65
    build: .
66
    image: tootsuite/mastodon
67 68
    restart: always
    env_file: .env.production
69
    command: node ./streaming
70 71 72
    networks:
      - external_network
      - internal_network
73
    healthcheck:
74
      test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
75
    ports:
76
      - "127.0.0.1:4000:4000"
77 78 79
    depends_on:
      - db
      - redis
80

81
  sidekiq:
82
    build: .
83
    image: tootsuite/mastodon
84
    restart: always
85
    env_file: .env.production
86
    command: bundle exec sidekiq
87 88 89
    depends_on:
      - db
      - redis
90 91 92
    networks:
      - external_network
      - internal_network
93 94
    volumes:
      - ./public/system:/mastodon/public/system
J Yeary's avatar
J Yeary committed
95 96 97 98
## 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:
99
#    image: sirboops/tor
J Yeary's avatar
J Yeary committed
100 101 102 103 104
#    networks:
#      - external_network
#      - internal_network
#
#  privoxy:
105
#    image: sirboops/privoxy
J Yeary's avatar
J Yeary committed
106 107 108 109 110
#    volumes:
#      - ./priv-config:/opt/config
#    networks:
#      - external_network
#      - internal_network
111 112 113 114 115

networks:
  external_network:
  internal_network:
    internal: true