Traefik configuration

This commit is contained in:
Vivianne 2023-01-17 00:08:40 -05:00
parent 87e490b5fa
commit 476195932b
1 changed files with 22 additions and 42 deletions

View File

@ -3,8 +3,8 @@ services:
db:
restart: always
image: postgres:14-alpine
shm_size: 2gb
command: postgres -c "max_connections=200" -c "shared_buffers=2GB" -c "effective_cache_size=6GB" -c "maintenance_work_mem=512MB" -c "checkpoint_completion_target=0.9" -c "wal_buffers=16MB" -c "default_statistics_target=100" -c "random_page_cost=1.1" -c "effective_io_concurrency=200" -c "work_mem=5242kB" -c "min_wal_size=1GB" -c "max_wal_size=4GB" -c "max_worker_processes=4" -c "max_parallel_workers_per_gather=2" -c "max_parallel_workers=4" -c "max_parallel_maintenance_workers=2"
shm_size: 1gb
command: postgres -c "max_connections=200" -c "shared_buffers=768MB" -c "effective_cache_size=2304MB" -c "maintenance_work_mem=192MB" -c "checkpoint_completion_target=0.9" -c "wal_buffers=16MB" -c "default_statistics_target=100" -c "random_page_cost=1.1" -c "effective_io_concurrency=200" -c "work_mem=1966kB" -c "min_wal_size=1GB" -c "max_wal_size=4GB"
networks:
- internal_network
healthcheck:
@ -51,13 +51,24 @@ services:
image: git.solarpunk.moe/solarpunk/mastodon
restart: always
env_file: .env.production
environment:
- WEB_CONCURRENCY=4
- MAX_THREADS=4
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
networks:
internal_network:
httpsproxy:
external_network:
aliases:
- masto_web
mail:
labels:
- "traefik.enable=true"
- "traefik.http.services.mastodon.loadbalancer.server.port=3000"
- "traefik.http.routers.mastodon.rule=Host(`solarpunk.moe`)"
- "traefik.http.routers.mastodon.tls.certresolver=leresolver"
- "traefik.http.routers.mastodon.entrypoints=websecure"
healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
@ -75,11 +86,19 @@ services:
env_file: .env.production
command: node ./streaming
networks:
httpsproxy:
internal_network:
external_network:
aliases:
- masto_streaming
mail:
labels:
- "traefik.enable=true"
- "traefik.http.services.mastodon-streaming.loadbalancer.server.port=4000"
- "traefik.http.routers.mastodon-streaming.rule=(Host(`solarpunk.moe`) && PathPrefix(`/api/v1/streaming`))"
- "traefik.http.routers.mastodon-streaming.tls.certresolver=leresolver"
- "traefik.http.routers.mastodon-streaming.entrypoints=websecure"
healthcheck:
# prettier-ignore
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
@ -104,8 +123,6 @@ services:
- mail
volumes:
- ./public/system:/mastodon/public/system
# healthcheck:
# test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-ingress-pull-push-default:
build: .
@ -124,8 +141,6 @@ services:
- mail
volumes:
- ./public/system:/mastodon/public/system
# healthcheck:
# test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-default-push-pull:
build: .
@ -144,15 +159,13 @@ services:
- mail
volumes:
- ./public/system:/mastodon/public/system
#healthcheck:
# test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
sidekiq-pull-push-default:
build: .
image: git.solarpunk.moe/solarpunk/mastodon:latest
restart: always
env_file: .env.production
command: bundle exec sidekiq -c 5 -q pull -q push -q default -q ingress
command: bundle exec sidekiq -c 8 -q pull -q push -q default -q ingress
environment:
- DB_POOL=5
depends_on:
@ -164,39 +177,6 @@ services:
- mail
volumes:
- ./public/system:/mastodon/public/system
#healthcheck:
# test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
## Uncomment to enable federation with tor instances along with adding the following ENV variables
## http_proxy=http://privoxy:8118
## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
# tor:
# image: sirboops/tor
# networks:
# - external_network
# - internal_network
#
# privoxy:
# image: sirboops/privoxy
# volumes:
# - ./priv-config:/opt/config
# networks:
# - external_network
# - internal_network
nginx:
image: nginx
restart: always
networks:
- httpsproxy
- external_network
volumes:
- ./templates:/etc/nginx/templates
environment:
- LETSENCRYPT_HOST=solarpunk.moe
- VIRTUAL_HOST=solarpunk.moe
- NGINX_HOST=solarpunk.moe
- NGINX_PORT=80
volumes:
elasticsearch: