Use merge references in compose

This commit is contained in:
Erik Stambaugh 2024-02-01 16:51:57 -08:00
parent 57b7345a62
commit 178833d478

View file

@ -59,69 +59,51 @@ services:
# - '127.0.0.1:9200:9200' # - '127.0.0.1:9200:9200'
mastodon_web: mastodon_web:
<<: &mastodon
build: src
image: local_mastodon
restart: always
env_file: .env.production
networks:
- mastodon
- nginx
depends_on:
- mastodon_db
- mastodon_redis
# - es
container_name: mastodon_web container_name: mastodon_web
build: src
image: ghcr.io/mastodon/mastodon:v4.2.1
restart: always
env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
networks:
- mastodon
- nginx
healthcheck: healthcheck:
# prettier-ignore # prettier-ignore
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']
ports: ports:
- '127.0.0.1:3000:3000' - '127.0.0.1:3000:3000'
depends_on:
- mastodon_db
- mastodon_redis
# - es
volumes: volumes:
- ./src/public/system:/mastodon/public/system - ./src/public/system:/mastodon/public/system
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
mastodon_streaming: mastodon_streaming:
<<: *mastodon
container_name: mastodon_streaming container_name: mastodon_streaming
build: src
image: ghcr.io/mastodon/mastodon:v4.2.1
restart: always
env_file: .env.production
environment: environment:
- PORT=5000 - PORT=5000
command: node ./streaming command: node ./streaming
networks:
- mastodon
- nginx
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']
ports: ports:
- '127.0.0.1:5000:5000' - '127.0.0.1:5000:5000'
depends_on:
- mastodon_db
- mastodon_redis
{% for i in range(mastodon_sidekiq_count) %} {% for i in range(mastodon_sidekiq_count) %}
mastodon_sidekiq_{{i}}: mastodon_sidekiq_{{ i }}:
container_name: mastodon_sidekiq_{{i}} <<: *mastodon
build: src container_name: mastodon_sidekiq_{{ i }}
image: ghcr.io/mastodon/mastodon:v4.2.1
restart: always
env_file: .env.production
environment: environment:
- DB_POOL={{ mastodon_sidekiq_threads}} - DB_POOL={{ mastodon_sidekiq_threads }}
command: bundle exec sidekiq -c {{ mastodon_sidekiq_threads}} command: bundle exec sidekiq -c {{ mastodon_sidekiq_threads }}
depends_on:
- mastodon_db
- mastodon_redis
networks:
- mastodon
- nginx
volumes: volumes:
- ./src/public/system:/mastodon/public/system - ./src/public/system:/mastodon/public/system
healthcheck: healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
{% endfor %} {% endfor %}
## Uncomment to enable federation with tor instances along with adding the following ENV variables ## Uncomment to enable federation with tor instances along with adding the following ENV variables