Implemented a new docker compose structure which seperates between docker compose files and environment variable file to protect credentials better. Also did recatoring. Changes not fully tested

This commit is contained in:
2025-02-04 22:37:07 +01:00
parent 5503326ea6
commit e50fd54f4e
85 changed files with 610 additions and 515 deletions

View File

@@ -6,8 +6,7 @@ services:
web:
image: ghcr.io/mastodon/mastodon:{{applications.mastodon.version}}
restart: {{docker_restart_policy}}
env_file: .env.production
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
healthcheck:
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
@@ -16,36 +15,28 @@ services:
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
volumes:
- data:/mastodon/public/system
logging:
driver: journald
{% include 'templates/docker/container/networks.yml.j2' %}
streaming:
image: ghcr.io/mastodon/mastodon-streaming:{{applications.mastodon.version}}
restart: {{docker_restart_policy}}
env_file: .env.production
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
command: node ./streaming
healthcheck:
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
ports:
- "127.0.0.1:{{ports.localhost.web_socket[application_id]}}:4000"
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
logging:
driver: journald
{% include 'templates/docker/container/networks.yml.j2' %}
sidekiq:
image: ghcr.io/mastodon/mastodon:{{applications.mastodon.version}}
restart: {{docker_restart_policy}}
env_file: .env.production
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
command: bundle exec sidekiq
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
volumes:
- data:/mastodon/public/system
healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
logging:
driver: journald
{% include 'templates/docker/container/networks.yml.j2' %}
{% include 'templates/docker/compose/volumes.yml.j2' %}