Skip to content

Commit

Permalink
use docker swarm
Browse files Browse the repository at this point in the history
  • Loading branch information
fono09 committed Sep 16, 2023
1 parent beec680 commit 2d9ef32
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ services:
- 5432
ports:
- '192.168.100.101:5432:5432'
deploy:
placement:
constraints: [node.hostname == okaya-srv-0]



redis:
restart: always
Expand All @@ -27,6 +32,9 @@ services:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- ./redis:/data
deploy:
placement:
constraints: [node.hostname == okaya-srv-0]

# es:
# restart: always
Expand Down Expand Up @@ -85,6 +93,10 @@ services:
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=ma.fono.jp
- LETSENCRYPT_EMAIL=fono@fono.jp
deploy:
mode: replicated
replicas: 3
endpoint_mode: vip

streaming:
build: .
Expand All @@ -103,6 +115,9 @@ services:
depends_on:
- db
- redis
deploy:
placement:
constraints: [node.hostname == okaya-srv-0]

sidekiq:
build: .
Expand All @@ -117,9 +132,13 @@ services:
- external_network
- internal_network
volumes:
- ./public/system:/mastodon/public/system
- public-system:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
deploy:
mode: replicated
replicas: 3
endpoint_mode: vip

## Uncomment to enable federation with tor instances along with adding the following ENV variables
## http_proxy=http://privoxy:8118
Expand All @@ -138,15 +157,20 @@ services:
# - external_network
# - internal_network

volumes:
public-system:
driver_opts:
type: "nfs"
o: "addr=192.168.100.101,rw"
device: ":/home/fono/ghq/github.com/tootsuite/mastodon/public/system"

networks:
external_network:
ipam:
config:
- subnet: 172.31.0.0/28
name: mastodon_external
external: true
internal_network:
internal: true
ipam:
config:
- subnet: 172.31.0.17/28
name: mastodon_internal
external: true
nginx_proxy_network:
name: nginx-proxy-okaya
external: true

0 comments on commit 2d9ef32

Please sign in to comment.