host mastodon redis on another machine

This commit is contained in:
Pim Kunis 2023-07-12 22:53:18 +02:00
parent fc47828451
commit b77d38a34e
2 changed files with 14 additions and 33 deletions

View file

@ -14,30 +14,13 @@ volumes:
device: ":/mnt/data/mastodon/system" device: ":/mnt/data/mastodon/system"
services: services:
redis:
image: redis:7-alpine
networks:
mastodon:
aliases:
- redis
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- type: bind
source: /mnt/data/mastodon/redis
target: /data
environment:
- 'REDIS_PASSWORD={{ mastodon_redis_password }}'
deploy:
placement:
constraints:
- "node.labels.mastodon == true"
web: web:
image: tootsuite/mastodon:v4.1 image: tootsuite/mastodon:v4.1
environment: environment:
- 'OTP_SECRET={{ otp_secret }}' - 'OTP_SECRET={{ otp_secret }}'
- 'SECRET_KEY_BASE={{ secret_key_base }}' - 'SECRET_KEY_BASE={{ secret_key_base }}'
- 'REDIS_HOST=redis' - 'REDIS_HOST=thecloud.dmz'
- 'REDIS_PASSWORD={{ mastodon_redis_password }}'
- 'DB_HOST=192.168.30.10' - 'DB_HOST=192.168.30.10'
- 'DB_USER=mastodon' - 'DB_USER=mastodon'
- 'DB_NAME=mastodon' - 'DB_NAME=mastodon'
@ -56,8 +39,6 @@ services:
- traefik - traefik
healthcheck: healthcheck:
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
depends_on:
- redis
volumes: volumes:
- type: volume - type: volume
source: system source: system
@ -85,7 +66,8 @@ services:
image: tootsuite/mastodon:v4.1 image: tootsuite/mastodon:v4.1
command: node ./streaming command: node ./streaming
environment: environment:
- 'REDIS_HOST=redis' - 'REDIS_HOST=thecloud.dmz'
- 'REDIS_PASSWORD={{ mastodon_redis_password }}'
- 'LOCAL_DOMAIN=social.pizzapim.nl' - 'LOCAL_DOMAIN=social.pizzapim.nl'
- 'DB_HOST=192.168.30.10' - 'DB_HOST=192.168.30.10'
- 'DB_USER=mastodon' - 'DB_USER=mastodon'
@ -97,8 +79,6 @@ services:
healthcheck: healthcheck:
# prettier-ignore # prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
depends_on:
- redis
deploy: deploy:
placement: placement:
constraints: constraints:
@ -118,13 +98,12 @@ services:
environment: environment:
- 'OTP_SECRET={{ otp_secret }}' - 'OTP_SECRET={{ otp_secret }}'
- 'SECRET_KEY_BASE={{ secret_key_base }}' - 'SECRET_KEY_BASE={{ secret_key_base }}'
- 'REDIS_HOST=redis' - 'REDIS_HOST=thecloud.dmz'
- 'REDIS_PASSWORD={{ mastodon_redis_password }}'
- 'DB_HOST=192.168.30.10' - 'DB_HOST=192.168.30.10'
- 'DB_USER=mastodon' - 'DB_USER=mastodon'
- 'DB_NAME=mastodon' - 'DB_NAME=mastodon'
- 'DB_PASS={{ database_passwords.mastodon }}' - 'DB_PASS={{ database_passwords.mastodon }}'
depends_on:
- redis
networks: networks:
- mastodon - mastodon
volumes: volumes:

View file

@ -8,12 +8,14 @@ mastodon_postgres_password: !vault |
6539616439636364626466333163316164633631616132623665 6539616439636364626466333163316164633631616132623665
mastodon_redis_password: !vault | mastodon_redis_password: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
35643365666261333939303162366366393933613034306438323031393763343065613034366331 32333531626630353438343331373139363731303264373336653162303431663231376565376662
3537383364313562623234363465363937613736616536360a323664306562653337616534313737 3332383365313462373030383462653266656338623035390a646437653364366638653764613766
62343433333033376363386333663632663965373963386432316136376563383763623631326133 32346135353230343631643661653935366635666263383233626133623432643938633064346431
3430346364303334380a613932336534346437346539623864306233626265336663343565303866 6162646335313965310a653831393364316530623331366166373032383063303237396266613335
33393665633236653536383636616537396432366532366438316135303437313736336536336264 31313537623161653731313736386539393830363566353234643263393761353061363839616131
3366643332306236376466386630666230366235333662663161 66346561323062333933373635626463313731643666643462653964666439383264326166383466
36646338653139626234653339386637373639633931616365633536616230613239656664333832
61346132353364323330
otp_secret: !vault | otp_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
33303436663063313039636335623937343530323636346363306234333135306138653337313034 33303436663063313039636335623937343530323636346363306234333135306138653337313034