summaryrefslogtreecommitdiffstats
path: root/mastodon.castle.yml
blob: 597caf2ad04f068a86f8c687ac42772ae93813c4 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
# Configuration adapted from
# https://github.com/bitnami/containers/blob/main/bitnami/mastodon/docker-compose.yml

# must be used as an overlay for the main docker-compose file. Ex
# docker-compose -f docker-compose.yml -f mastodon.castle.yml up

# defaults
# admin: user@bitnami.org
# password: bitnami1

services:
  mastodon:
    container_name: mastodon.castle
    labels:
      - traefik.http.routers.mastodon.rule=Host(`mastodon.castle`)
      - traefik.http.routers.mastodon.tls=true
      - traefik.http.routers.mastodon.tls.certresolver=smallstep
      - traefik.port=3000
      - traefik.enable=true
    depends_on:
      - mastodon_db
      - mastodon_es
      - mastodon_redis
    image: mastodon-sandcastle
    build:
      dockerfile: mastodon.Dockerfile
    volumes:
      - 'mastodon_data:/bitnami/mastodon'
    networks:
      - mastodon
      - fediverse
      - default
    environment:
      - MASTODON_DATABASE_HOST=mastodon_db
      - MASTODON_REDIS_HOST=mastodon_redis
      - MASTODON_ELASTICSEARCH_HOST=mastodon_es
      - ALLOW_EMPTY_PASSWORD=yes
      - MASTODON_MODE=web
      - MASTODON_DATABASE_PASSWORD=bitnami1
      - MASTODON_ELASTICSEARCH_PASSWORD=bitnami123
      - LOCAL_DOMAIN=mastodon.castle
      - WEB_DOMAIN=mastodon.castle
  
  mastodon-streaming:
    depends_on:
      - mastodon
    image: docker.io/bitnami/mastodon:4
    networks:
      - mastodon
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MASTODON_MODE=streaming
      - MASTODON_DATABASE_PASSWORD=bitnami1
      - MASTODON_ELASTICSEARCH_PASSWORD=bitnami123
      - MASTODON_REDIS_HOST=mastodon_redis
  mastodon-sidekiq:
    depends_on:
      - mastodon
    image: docker.io/bitnami/mastodon:4
    volumes:
      - 'mastodon_data:/bitnami/mastodon'
    networks:
      - mastodon
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MASTODON_MODE=sidekiq
      - MASTODON_DATABASE_PASSWORD=bitnami1
      - MASTODON_ELASTICSEARCH_PASSWORD=bitnami123
      - MASTODON_REDIS_HOST=mastodon_redis
      - MASTODON_DATABASE_HOST=mastodon_db
  mastodon_db:
    image: docker.io/bitnami/postgresql:16
    networks:
      - mastodon
    volumes:
      - 'mastodon_db_data:/bitnami/postgresql'
    environment:
      - POSTGRESQL_DATABASE=bitnami_mastodon
      - POSTGRESQL_USERNAME=bn_mastodon
      - POSTGRESQL_PASSWORD=bitnami1
  mastodon_redis:
    image: docker.io/bitnami/redis:7.0
    volumes:
      - 'redis_data:/bitnami/redis'
    networks:
      - mastodon
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
  mastodon_es:
    image: docker.io/bitnami/elasticsearch:8
    networks:
      - mastodon
    volumes:
      - 'elasticsearch_data:/bitnami/elasticsearch/data'
    environment:
      - ELASTICSEARCH_ENABLE_SECURITY=true
      - ELASTICSEARCH_SKIP_TRANSPORT_TLS=true
      - ELASTICSEARCH_ENABLE_REST_TLS=false
      - ELASTICSEARCH_PASSWORD=bitnami123

  # Configure docker's internal DNS
  # Traefik will provide SSL termination and proxy back to mastodon
  proxy:
    networks:
      default:
        aliases:
          - mastodon.castle
      fediverse:
        aliases:
          - mastodon.castle

volumes:
  mastodon_db_data:
    driver: local
  minio_data:
    driver: local
  redis_data:
    driver: local
  elasticsearch_data:
    driver: local
  mastodon_data:
    driver: local

networks:
  mastodon:
    internal: true