-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
136 lines (129 loc) · 4.12 KB
/
docker-compose.yml
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
129
130
131
132
133
134
135
136
version: '3'
services:
postgresql:
container_name: postgresql
image: docker.io/postgres:15.3
env_file: mastodon.prod.env
restart: always
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- /opt/mastodon/database/postgresql:/var/lib/postgresql/data
networks:
- internal_network
redis:
container_name: redis
image: docker.io/redis:7.0.11
restart: always
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- /opt/mastodon/database/redis:/data
networks:
- internal_network
web:
container_name: mastodon-web
image: ghcr.io/mastodon/mastodon:v4.1.2@sha256:6b18e6d0eda476397d48cc36ac040b5da9c73503e374708a815a7f76db740576
env_file:
- mastodon.prod.env
command: bash -c "bundle exec puma -C config/puma.rb"
restart: always
depends_on:
- postgresql
- redis
- elasticsearch
ports:
- '127.0.0.1:3000:3000'
networks:
- internal_network
- external_network
labels:
- "traefik.enable=true"
- "traefik.http.services.photoprism-social.loadbalancer.server.port=3000"
- "traefik.http.services.photoprism-social.loadbalancer.server.scheme=http"
- "traefik.http.routers.photoprism-social.entrypoints=websecure"
- "traefik.http.routers.photoprism-social.rule=Host(`localssl.dev`, `app.localssl.dev`)"
- "traefik.http.routers.photoprism-social.tls.domains[0].main=localssl.dev"
- "traefik.http.routers.photoprism-social.tls.domains[0].sans=*.localssl.dev"
- "traefik.http.routers.photoprism-social.tls=true"
healthcheck:
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
volumes:
- /opt/mastodon/web/system:/mastodon/public/system
streaming:
container_name: mastodon-streaming
image: ghcr.io/mastodon/mastodon:v4.1.2@sha256:6b18e6d0eda476397d48cc36ac040b5da9c73503e374708a815a7f76db740576
env_file:
- mastodon.prod.env
command: node ./streaming
restart: always
depends_on:
- postgresql
- redis
ports:
- '127.0.0.1:4000:4000'
networks:
- internal_network
- external_network
healthcheck:
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
sidekiq:
container_name: mastodon-sidekiq
image: ghcr.io/mastodon/mastodon:v4.1.2@sha256:6b18e6d0eda476397d48cc36ac040b5da9c73503e374708a815a7f76db740576
env_file:
- mastodon.prod.env
command: bundle exec sidekiq -c 25 -q default,8 -q push,6 -q ingress,4 -q mailers,2 -q pull -q scheduler
restart: always
depends_on:
- postgresql
- redis
- web
networks:
- internal_network
- external_network
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
volumes:
- /opt/mastodon/web/system:/mastodon/public/system
tootctl:
container_name: tootctl
image: ghcr.io/mastodon/mastodon:v4.1.2@sha256:6b18e6d0eda476397d48cc36ac040b5da9c73503e374708a815a7f76db740576
env_file:
- mastodon.prod.env
command: bash -c "bundle exec bin/tootctl $*"
networks:
- internal_network
elasticsearch:
image: docker.io/elasticsearch:7.17.10
container_name: elasticsearch
restart: always
env_file: mastodon.prod.env
environment:
- cluster.name=elasticsearch-mastodon
- discovery.type=single-node
- bootstrap.memory_lock=true
- xpack.security.enabled=true
- ingest.geoip.downloader.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: ["CMD-SHELL", "nc -z elasticsearch 9200"]
volumes:
- /opt/mastodon/database/elasticsearch:/usr/share/elasticsearch/data
networks:
- internal_network
traefik:
image: photoprism/traefik:latest
ports:
- "80:80" # HTTP (redirects to HTTPS)
- "443:443" # HTTPS (required)
labels:
- "traefik.enable=true"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock" # enables Traefik to watch services
networks:
external_network:
internal_network:
internal: true