about summary refs log tree commit diff
path: root/in-a-box/docker-compose.yml
blob: ff71ceaa02eaad5bfbfc56f8f7ff16fd48326846 (plain) (blame)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
version: '2.1'
services:

  nginx:
    restart: always
    image: nginx:mainline
    volumes:
      - ./.docker/nginx/nginx.conf:/etc/nginx/conf.d/template.ro:ro
#     Replace the /path/to/letsencrypt/stuff.pem with wherever the corresponding files are:
      - /path/to/letsencrypt/fullchain.pem:/etc/ssl/fullchain.pem:ro
      - /path/to/letsencrypt/privkey.pem:/etc/ssl/privkey.pem:ro
      - /path/to/letsencrypt/cert.pem:/etc/ssl/cert.pem:ro
      - ./public:/var/www/html:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "80:80"
      - "443:443"
    environment:
#       Replace example.com with your webserver:
      - NGINX_HOST=example.com
    networks:
      - external_network
    command: sh -c "envsubst \"`env | awk -F = '{printf \" $$%s, $$1}'`\" < /etc/nginx/conf.d/template.ro > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"

  mstdb:
    restart: always
    image: postgres:10.3-alpine
    networks:
      - mstdb_network
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./.docker/mastodon/db:/var/lib/postgresql/data

  mstredis:
    restart: always
    image: redis:alpine
    networks:
      - mstredis_network
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./.docker/mastodon/redis:/data

#  mstes:
#    restart: always
#    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
#    environment:
#      - bootstrap.memory_lock=true
#      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
#    ulimits:
#      memlock:
#        soft: -1
#        hard: -1
#    networks:
#      - mstes_network
#    volumes:
#      - /etc/localtime:/etc/localtime:ro
#      - /etc/timezone:/etc/timezone:ro
#      - ./.docker/mastodon/es:/usr/share/elasticsearch/data

  mstweb:
    image: pluralcafe/mastodon:stable
    restart: always
# Get .env.production from https://raw.githubusercontent.com/tootsuite/mastodon/master/.env.production.sample
    env_file: ./.docker/mastodon/.env.production
    networks:
      - external_network
      - mstdb_network
      - mstredis_network
    depends_on:
      - mstdb
      - mstredis
#      - mstes
    volumes:
      - ./public/system:/mastodon/public/system
      - /etc/localtime:/etc/localtime:ro

networks:
  external_network:
# Uncomment the below for IPv6 support and fill in the last subnet
# with the IPv6 subnet your hosting provider gave you
#    driver: bridge
#    enable_ipv6: true
#    ipam:
#      driver: default
#      config:
#        - subnet: 172.18.0.0/16
#        - subnet: 2600:1111:2222:3333::/64
  mstdb_network:
    internal: true
  mstredis_network:
    internal: true