Compare commits
4 commits
a7ffcfdea8
...
4da5f18fb2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4da5f18fb2 | ||
![]() |
1e8484b180 | ||
![]() |
c879f5ae93 | ||
![]() |
36210c1d74 |
12 changed files with 101 additions and 0 deletions
|
@ -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
|
19
ansible/playbooks/skull-it/skullit1.yml
Normal file
19
ansible/playbooks/skull-it/skullit1.yml
Normal 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
|
5
ansible/roles/deploy_container_localai/defaults/main.yml
Normal file
5
ansible/roles/deploy_container_localai/defaults/main.yml
Normal 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
|
0
ansible/roles/deploy_container_localai/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_localai/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_localai/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_localai/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_localai/meta/main.yml
Normal file
0
ansible/roles/deploy_container_localai/meta/main.yml
Normal file
25
ansible/roles/deploy_container_localai/tasks/main.yml
Normal file
25
ansible/roles/deploy_container_localai/tasks/main.yml
Normal 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
|
2
ansible/roles/deploy_container_localai/templates/.env.j2
Normal file
2
ansible/roles/deploy_container_localai/templates/.env.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
LOCALAI_VERSION={{ container_localai_version }}
|
||||||
|
LOCALAI_DOMAIN={{ container_localai_domain }}
|
|
@ -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
|
1
ansible/roles/deploy_container_localai/vars/main.yml
Normal file
1
ansible/roles/deploy_container_localai/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
container_base_dir: /opt/docker/localai
|
|
@ -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 }}"
|
||||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue