Add podman option

This commit is contained in:
Antonio J. Delgado 2022-11-19 12:23:23 +02:00
parent dd771f0ee2
commit 8a8b036df8
3 changed files with 64 additions and 0 deletions

View file

@ -1,6 +1,12 @@
---
mastodon_db_password: "{{ vault_mastodon_db_password }}"
redis_pass: "{{ vault_mastodon_redis_password }}"
mastodon_secret_key_base: "{{ vault_mastodon_secret_key_base }}"
mastodon_otp_secret: "{{ vault_mastodon_otp_secret }}"
vapid_public_key: "{{ vault_vapid_public_key }}"
vapid_private_key: "{{ vault_vapid_private_key }}"
smtp_from_address: mastodon-admin@example.com
smtp_server: mail.example.com
mastodon_host: mastodon.example.com
#Use HTTP only for Vagrant testing or for reverse proxy purposes.
use_http: true

View file

@ -6,4 +6,9 @@
when: ansible_distribution == 'Ubuntu'
- import_tasks: docker/core.yml
- import_tasks: docker/docker.yml
when: docker_command == 'docker'
- import_tasks: docker/podman.yml
when: docker_command == 'podman'

53
tasks/docker/podman.yml Normal file
View file

@ -0,0 +1,53 @@
---
- podman_container:
name: redis_mastodon
image: redis:4.0-alpine
restart_policy: on-failure
- podman_container:
name: db_mastodon
image: postgresql:15
restart_policy: on-failure
env_file: /mastodon/.env
env:
- POSTGRES_USER: "{{ db_user }}"
- POSTGRES_PASSWORD: "{{ db_password }}"
- POSTGRES_DB: "{{ db_name }}"
- podman_container:
name: app_mastodon
image: "gargron/mastodon:v{{ mastodon_release }}"
command: bundle exec rails s -p 3000 -b '0.0.0.0'
restart_policy: on-failure
env_file: /mastodon/.env
- podman_container:
name: sidekiq_mastodon
image: "moritzheiber/mastodon-docker"
command: bundle exec sidekiq -q default -q mailers -q pull -q push
restart_policy: on-failure
env_file: /mastodon/.env
- podman_container:
project_name: streaming_mastodon
image: "moritzheiber/mastodon-docker"
command: npm run start
restart_policy: on-failure
env_file: /mastodon/.env
# - docker_service:
# project_name: web
# definition:
# version: "2.3"
# services:
# web:
# image: "moritzheiber/mastodon-docker"
# networks:
# - "{{ mastodon_docker_network }}"
# command: bundle exec rails s -p 3000 -b '0.0.0.0'
# restart_policy: on-failure
# env_file: /mastodon/.env
# networks:
# "{{ mastodon_docker_network }}":
# external: true
# notify: "restart caddy webserver"