Add Container Skullbot

This commit is contained in:
= 2025-09-20 00:20:30 +02:00
parent 23019f133c
commit aa747ba3e7
9 changed files with 63 additions and 0 deletions

View file

@ -83,3 +83,8 @@
tags: tags:
- mailarchive - mailarchive
- docker-container - docker-container
- role: deploy_container_skullbot
tags:
- skullbot
- docker-container

View file

@ -0,0 +1,7 @@
############
# Skullbot #
############
container_skullbot_bot_token: your_discord_token
container_skullbot_discord_channel_id: "123456789012345678"
container_skullbot_telegram_token: your_telegram_token
container_skullbot_telegram_chat_id: -123456789

View file

@ -0,0 +1,37 @@
---
- name: Ensure data directories exist
ansible.builtin.file:
path: "{{ container_base_dir }}/data"
state: directory
mode: '0755'
become: false
- name: Clone Skullbot repository
ansible.builtin.git:
repo: "https://skulldev.de/kevinheyer/Skullbot"
dest: "{{ container_base_dir }}/data"
become: false
- name: Create events.db
ansible.builtin.file:
path: "{{ container_base_dir }}/data/events.db"
state: touch
become: false
- name: Deploy Docker Compose and .env files
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ container_base_dir }}/{{ item.dest }}"
mode: '0644'
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
- { src: '.env.j2', dest: 'data/.env' }
become: false
- name: Start Container
community.docker.docker_compose_v2:
project_src: "{{ container_base_dir }}"
pull: always
docker_host: "unix:///run/user/1000/docker.sock"
build: always
become: false

View file

@ -0,0 +1,4 @@
BOT_TOKEN={{ container_skullbot_bot_token }}
DISCORD_CHANNEL_ID={{ container_skullbot_discord_channel_id }}
TELEGRAM_TOKEN= {{ container_skullbot_telegram_token }}
TELEGRAM_CHAT_ID={{ container_skullbot_telegram_chat_id }}

View file

@ -0,0 +1,9 @@
---
services:
skullbot:
build: ./data/
container_name: skullbot
restart: unless-stopped
volumes:
- ./data/events.db:/app/events.db
tty: true

View file

@ -0,0 +1 @@
container_base_dir: /opt/docker/skullbot