Compare commits
1 Commits
b0f8c1a82e
...
327943d96a
Author | SHA1 | Date | |
---|---|---|---|
327943d96a
|
@ -13,17 +13,30 @@ mastodon_config_env_file: "{{ mastodon_config_path }}/env.production"
|
||||
|
||||
mastodon_container_name: mastodon
|
||||
mastodon_container_name_sidekiq: "{{ mastodon_container_name }}_sidekiq"
|
||||
mastodon_container_name_streaming: "{{ mastodon_container_name }}_streaming }}"
|
||||
mastodon_container_name_streaming: "{{ mastodon_container_name }}_streaming"
|
||||
mastodon_container_image_name: "tootsuite/mastodon"
|
||||
mastodon_container_image_tag: "v{{ mastodon_version }}"
|
||||
mastodon_container_image_ref: "{{ mastodon_container_image_name }}:{{ mastodon_container_image_tag }}"
|
||||
mastodon_container_networks:
|
||||
- name: "{{ mastodon_container_network_name }}"
|
||||
mastodon_container_volumes_streaming: []
|
||||
mastodon_container_volumes_sidekiq:
|
||||
|
||||
mastodon_container_base_volumes_streaming: []
|
||||
mastodon_container_extra_volumes_streaming: "{{ mastodon_container_extra_volumes }}"
|
||||
mastodon_container_volumes_streaming: >-
|
||||
{{ mastodon_container_base_volumes_streaming + mastodon_container_extra_volumes_streaming }}
|
||||
|
||||
mastodon_container_base_volumes_sidekiq:
|
||||
- "{{ mastodon_repo_path }}/public/system:/mastodon/public/system:ro"
|
||||
mastodon_container_volumes:
|
||||
- "{{ mastodon_repo_path }}/public/system:/mastodon/public/system:x"
|
||||
mastodon_container_extra_volumes_sidekiq: "{{ mastodon_container_extra_volumes }}"
|
||||
mastodon_container_volumes_sidekiq: >-
|
||||
{{ mastodon_container_base_volumes_sidekiq + mastodon_container_extra_volumes_sidekiq }}
|
||||
|
||||
mastodon_container_base_volumes:
|
||||
- "{{ mastodon_repo_path }}/public/system:/mastodon/public/system:z"
|
||||
mastodon_container_extra_volumes: []
|
||||
mastodon_container_volumes: >-
|
||||
{{ mastodon_container_base_volumes + mastodon_container_extra_volumes }}
|
||||
|
||||
mastodon_container_ports_streaming:
|
||||
- "127.0.0.1:4000:4000"
|
||||
mastodon_container_ports:
|
||||
@ -39,7 +52,7 @@ mastodon_vapid_private_key: ~
|
||||
|
||||
mastodon_redis_host: ~
|
||||
mastodon_redis_port: ~
|
||||
mastodon_redis_pass: ~
|
||||
mastodon_redis_password: ~
|
||||
mastodon_redis_db_index: ~
|
||||
|
||||
mastodon_database_host: localhost
|
||||
|
@ -48,14 +48,6 @@
|
||||
name: "{{ mastodon_container_network_name }}"
|
||||
state: present
|
||||
|
||||
- name: Ensure environment file is templated
|
||||
template:
|
||||
src: env.j2
|
||||
dest: "{{ mastodon_config_env_file }}"
|
||||
owner: "{{ mastodon_user_info.uid | default(mastodon_user) }}"
|
||||
group: "{{ mastodon_user_info.group | default(mastodon_user) }}"
|
||||
mode: "0640"
|
||||
|
||||
- name: Ensure mastodon docker image is built
|
||||
docker_image:
|
||||
name: "{{ mastodon_container_image_name }}"
|
||||
@ -69,6 +61,19 @@
|
||||
GID: "{{ mastodon_user_info.group }}"
|
||||
when: git_repo_info.before != git_repo_info.after
|
||||
|
||||
- name: Ensure database is seeded
|
||||
docker_container:
|
||||
name: "{{ mastodon_container_name }}_setup_db"
|
||||
image: "{{ mastodon_container_image_ref }}"
|
||||
networks: "{{ mastodon_container_networks }}"
|
||||
volumes: "{{ mastodon_container_volumes }}"
|
||||
env_file: "{{ mastodon_config_env_file }}"
|
||||
command: "bash -c \"bundle exec rails db:setup\""
|
||||
tty: yes
|
||||
interactive: yes
|
||||
detach: no
|
||||
cleanup: yes
|
||||
|
||||
- name: Ensure mastodon sidekiq container '{{ mastodon_container_name_sidekiq }}' is running
|
||||
docker_container:
|
||||
name: "{{ mastodon_container_name_sidekiq }}"
|
||||
@ -76,7 +81,7 @@
|
||||
networks: "{{ mastodon_container_networks }}"
|
||||
volumes: "{{ mastodon_container_volumes_sidekiq }}"
|
||||
env_file: "{{ mastodon_config_env_file }}"
|
||||
command: "bundle exex sidekiq"
|
||||
command: "bundle exec sidekiq"
|
||||
restart_policy: "{{ mastodon_container_restart_policy }}"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "ps aux | grep '[s]idekiq\ 6' || false"]
|
||||
@ -102,9 +107,9 @@
|
||||
start_period: 0s
|
||||
timeout: 5s
|
||||
|
||||
- name: Ensure mastodon streaming container '{{ mastodon_container_name_streaming }}' is running
|
||||
- name: Ensure mastodon container '{{ mastodon_container_name }}' is running
|
||||
docker_container:
|
||||
name: "{{ mastodon_container_name_streaming }}"
|
||||
name: "{{ mastodon_container_name }}"
|
||||
image: "{{ mastodon_container_image_ref }}"
|
||||
networks: "{{ mastodon_container_networks }}"
|
||||
volumes: "{{ mastodon_container_volumes }}"
|
||||
|
@ -21,10 +21,10 @@ LOCAL_DOMAIN={{ mastodon_domain }}
|
||||
REDIS_HOST={{ mastodon_redis_host }}
|
||||
REDIS_PORT={{ mastodon_redis_port }}
|
||||
{% if mastodon_redis_password %}
|
||||
REDIS_PASSWORD={{ mastodon_redis_password }
|
||||
REDIS_PASSWORD={{ mastodon_redis_password }}
|
||||
{% endif %}
|
||||
{% if mastodon_redis_db_index %}
|
||||
REDIS_PASSWORD={{ mastodon_redis_db_index }
|
||||
REDIS_PASSWORD={{ mastodon_redis_db_index }}
|
||||
{% endif %}
|
||||
|
||||
# PostgreSQL
|
||||
|
Reference in New Issue
Block a user