Compare commits

..

4 commits

Author SHA1 Message Date
=
4da5f18fb2 add cookies 2025-09-21 09:59:28 +02:00
=
1e8484b180 add container localai 2025-09-21 09:59:18 +02:00
=
c879f5ae93 add skull1 2025-09-21 09:59:06 +02:00
=
36210c1d74 Add Immich & Mealie 2025-09-21 09:59:00 +02:00
12 changed files with 101 additions and 0 deletions

View file

@ -88,3 +88,13 @@
tags: tags:
- skullbot - skullbot
- docker-container - docker-container
- role: deploy_container_immich
tags:
- immich
- docker-container
- role: deploy_container_mealie
tags:
- mealie
- docker-container

View file

@ -0,0 +1,19 @@
---
- name: Configure skullit1
hosts: skullit1
roles:
- role: server_bootstrap
tags:
- cronjobs
- system
- role: server_install_cronjobs
tags:
- cronjobs
- system
- role: deploy_container_traefik_with_letsencrypt
tags:
- docker
- container
- traefik

View file

@ -0,0 +1,5 @@
###########
# LocalAI #
###########
container_localai_version: v3.5.0-aio-cpu # https://hub.docker.com/r/localai/localai/tags?name=cpu
container_localai_domain: localai.example.com

View file

@ -0,0 +1,25 @@
- name: Ensure data directories exist
ansible.builtin.file:
path: "{{ container_base_dir }}/data/{{ item }}"
state: directory
mode: '0755'
loop:
- "models"
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: '.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"
become: false

View file

@ -0,0 +1,2 @@
LOCALAI_VERSION={{ container_localai_version }}
LOCALAI_DOMAIN={{ container_localai_domain }}

View file

@ -0,0 +1,32 @@
---
services:
api:
image: localai/localai:${LOCALAI_VERSION}
container_name: localai
networks:
- traefik
volumes:
- ./data/models:/models:cached
environment:
- DEBUG=true
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.localai.entrypoints=http"
- "traefik.http.routers.localai.rule=Host(`${LOCALAI_DOMAIN}`)"
- "traefik.http.middlewares.localai-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.localai.middlewares=localai-https-redirect"
- "traefik.http.routers.localai-secure.entrypoints=https"
- "traefik.http.routers.localai-secure.rule=Host(`${LOCALAI_DOMAIN}`)"
- "traefik.http.routers.localai-secure.tls=true"
- "traefik.http.routers.localai-secure.service=localai"
- "traefik.http.services.localai.loadbalancer.server.port=8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
interval: 1m
timeout: 20m
retries: 5
networks:
traefik:
external: true

View file

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

View file

@ -18,6 +18,12 @@
state: touch state: touch
become: false become: false
- name: Create cookies.txt
ansible.builtin.file:
path: "{{ container_base_dir }}/data/cookies.txt"
state: touch
become: false
- name: Deploy Docker Compose and .env files - name: Deploy Docker Compose and .env files
ansible.builtin.template: ansible.builtin.template:
src: "{{ item.src }}" src: "{{ item.src }}"

View file

@ -6,4 +6,5 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./data/events.db:/app/events.db - ./data/events.db:/app/events.db
- ./data/cookies.txt:/app/cookies.txt:ro
tty: true tty: true