hub.moon.moe/docker-compose.yml

120 lines
2.6 KiB
YAML
Raw Normal View History

2023-07-15 21:12:25 -04:00
---
version: "3"
services:
db:
container_name: mastodon-db
restart: always
image: postgres:15-alpine
shm_size: 256mb
networks:
- internal_network
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
2024-03-22 23:21:39 -04:00
- ./data/postgres:/var/lib/postgresql/data
2023-07-15 21:12:25 -04:00
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
redis:
container_name: mastodon-redis
restart: always
image: redis:7-alpine
networks:
- internal_network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
volumes:
2024-03-22 23:21:39 -04:00
- ./data/redis:/data
2023-07-15 21:12:25 -04:00
web:
container_name: mastodon-web
build: .
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:
test:
- CMD-SHELL
- wget -q --spider --proxy=off localhost:3000/health || exit 1
depends_on:
- db
- redis
volumes:
2024-03-28 19:58:22 -04:00
- ./mastodon:/opt/my-mastodon
2023-07-15 21:12:25 -04:00
streaming:
container_name: mastodon-streaming
build: .
restart: always
env_file: .env.production
command: node ./streaming
depends_on:
- db
- redis
networks:
- external_network
- internal_network
healthcheck:
test:
- CMD-SHELL
- wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1
2024-03-22 23:21:39 -04:00
volumes:
2024-03-28 19:58:22 -04:00
- ./mastodon:/opt/my-mastodon
2023-07-15 21:12:25 -04:00
sidekiq:
container_name: mastodon-sidekiq
build: .
restart: always
env_file: .env.production
command: bundle exec sidekiq
depends_on:
- db
- redis
networks:
- external_network
- internal_network
healthcheck:
test:
- CMD-SHELL
- ps aux | grep '[s]idekiq 6' || false
volumes:
2024-03-28 19:58:22 -04:00
- ./mastodon:/opt/my-mastodon
2023-07-15 21:12:25 -04:00
nginx:
container_name: mastodon-nginx
restart: always
image: nginx:latest
2024-03-22 23:21:39 -04:00
depends_on:
- web
2023-07-15 21:12:25 -04:00
networks:
- external_network
- internal_network
ports:
# only needs http
- 127.0.0.1:3001:80
# - 127.0.0.1:3002:443
volumes:
2024-03-22 23:21:39 -04:00
- ./mastodon/public:/mastodon/public
2023-07-15 21:12:25 -04:00
- ./nginx/conf.d:/etc/nginx/conf.d
2024-03-22 23:21:39 -04:00
- ./data/nginx-cache:/var/cache/nginx
2023-07-15 21:12:25 -04:00
2023-07-16 17:19:20 -04:00
duplicity:
container_name: mastodon-duplicity
hostname: mastodon-duplicity
restart: always
image: ghcr.io/tecnativa/docker-duplicity-postgres-s3:v3.1.1
env_file: .env.duplicity
networks:
- internal_network
- external_network
volumes:
2024-03-22 23:21:39 -04:00
- ./data/redis:/mnt/redis:ro
2023-07-16 17:19:20 -04:00
2023-07-15 21:12:25 -04:00
networks:
external_network:
internal_network:
internal: true