90 lines
2.2 KiB
Text
90 lines
2.2 KiB
Text
|
version: '3'
|
||
|
services:
|
||
|
db:
|
||
|
restart: always
|
||
|
image: postgres:14-alpine
|
||
|
shm_size: 256mb
|
||
|
networks:
|
||
|
- internal_network
|
||
|
healthcheck:
|
||
|
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||
|
volumes:
|
||
|
- /data/mastodon/postgres14:/var/lib/postgresql/data
|
||
|
environment:
|
||
|
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
||
|
- 'POSTGRES_PASSWORD={{ mastodon_postgres_password }}'
|
||
|
- 'POSTGRES_DB=mastodon_production'
|
||
|
- 'POSTGRES_USER=mastodon'
|
||
|
|
||
|
redis:
|
||
|
restart: always
|
||
|
image: redis:7-alpine
|
||
|
networks:
|
||
|
- internal_network
|
||
|
healthcheck:
|
||
|
test: ['CMD', 'redis-cli', 'ping']
|
||
|
volumes:
|
||
|
- /data/mastodon/redis:/data
|
||
|
environment:
|
||
|
- 'REDIS_PASSWORD={{ mastodon_redis_password }}'
|
||
|
|
||
|
web:
|
||
|
image: tootsuite/mastodon:v3.5.3
|
||
|
restart: always
|
||
|
env_file: .env.production
|
||
|
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
|
||
|
networks:
|
||
|
- external_network
|
||
|
- internal_network
|
||
|
healthcheck:
|
||
|
# prettier-ignore
|
||
|
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
|
||
|
ports:
|
||
|
- '0.0.0.0:3000:3000'
|
||
|
- '[::]:3000:3000'
|
||
|
depends_on:
|
||
|
- db
|
||
|
- redis
|
||
|
# - es
|
||
|
volumes:
|
||
|
- /data/mastodon/public/system:/mastodon/public/system
|
||
|
|
||
|
streaming:
|
||
|
image: tootsuite/mastodon:v3.5.3
|
||
|
restart: always
|
||
|
env_file: .env.production
|
||
|
command: node ./streaming
|
||
|
networks:
|
||
|
- external_network
|
||
|
- internal_network
|
||
|
healthcheck:
|
||
|
# prettier-ignore
|
||
|
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
|
||
|
ports:
|
||
|
- '0.0.0.0:4000:4000'
|
||
|
- '[::]:4000:4000'
|
||
|
depends_on:
|
||
|
- db
|
||
|
- redis
|
||
|
|
||
|
sidekiq:
|
||
|
image: tootsuite/mastodon:v3.5.3
|
||
|
restart: always
|
||
|
env_file: .env.production
|
||
|
command: bundle exec sidekiq
|
||
|
depends_on:
|
||
|
- db
|
||
|
- redis
|
||
|
networks:
|
||
|
- external_network
|
||
|
- internal_network
|
||
|
volumes:
|
||
|
- /data/mastodon/public/system:/mastodon/public/system
|
||
|
healthcheck:
|
||
|
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
|
||
|
|
||
|
networks:
|
||
|
external_network:
|
||
|
internal_network:
|
||
|
internal: true
|