Add Container Mealie
This commit is contained in:
parent
8472820480
commit
23c7cd187d
8 changed files with 105 additions and 0 deletions
22
ansible/roles/deploy_container_mealie/defaults/main.yml
Normal file
22
ansible/roles/deploy_container_mealie/defaults/main.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
##########
|
||||||
|
# Mealie #
|
||||||
|
##########
|
||||||
|
# defaults for container_mealie
|
||||||
|
|
||||||
|
container_mealie_version: "latest"
|
||||||
|
container_mealie_allow_signup: "false"
|
||||||
|
container_mealie_loglevel: "INFO"
|
||||||
|
container_mealie_domain: "mealie.example.com"
|
||||||
|
|
||||||
|
# Database settings
|
||||||
|
container_mealie_dbengine: "sqlite" # möglich: sqlite, postgres
|
||||||
|
container_mealie_db_user: "mealie"
|
||||||
|
container_mealie_db_password: "yourpassword"
|
||||||
|
container_mealie_db_name: "mealie"
|
||||||
|
|
||||||
|
# SMTP settings
|
||||||
|
container_mealie_smtp_host: "smtp.example.com"
|
||||||
|
container_mealie_smtp_port: 587
|
||||||
|
container_mealie_smtp_from_mail: "noreply@example.com"
|
||||||
|
container_mealie_smtp_auth: "TLS" # möglich: TLS, SSL, NONE
|
||||||
|
container_mealie_smtp_password: "changeme"
|
0
ansible/roles/deploy_container_mealie/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_mealie/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_mealie/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_mealie/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_mealie/meta/main.yml
Normal file
0
ansible/roles/deploy_container_mealie/meta/main.yml
Normal file
24
ansible/roles/deploy_container_mealie/tasks/main.yml
Normal file
24
ansible/roles/deploy_container_mealie/tasks/main.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
- name: Ensure data directories exist
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ container_base_dir }}/"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
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
|
13
ansible/roles/deploy_container_mealie/templates/.env.j2
Normal file
13
ansible/roles/deploy_container_mealie/templates/.env.j2
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
MEALIE_VERSION={{ container_mealie_version }}
|
||||||
|
MEALIE_DOMAIN={{ container_mealie_domain }}
|
||||||
|
MEALIE_ALLOW_SIGNUP={{ container_mealie_allow_signup }}
|
||||||
|
MEALIE_LOGLEVEL={{ container_mealie_loglevel }}
|
||||||
|
MEALIE_DBENGINE={{ container_mealie_dbengine }}
|
||||||
|
MEALIE_DB_USER={{ container_mealie_db_user }}
|
||||||
|
MEALIE_DB_PASSWORD={{ container_mealie_db_password }}
|
||||||
|
MEALIE_DB_NAME={{ container_mealie_db_name }}
|
||||||
|
MEALIE_SMTP_HOST={{ container_mealie_smtp_host }}
|
||||||
|
MEALIE_SMTP_PORT={{ container_mealie_smtp_port }}
|
||||||
|
MEALIE_SMTP_FROM_MAIL={{ container_mealie_smtp_from_mail }}
|
||||||
|
MEALIE_SMTP_AUTH={{ container_mealie_smtp_auth }}
|
||||||
|
MEALIE_SMTP_PASSWORD={{ container_mealie_smtp_password }}
|
|
@ -0,0 +1,45 @@
|
||||||
|
---
|
||||||
|
services:
|
||||||
|
mealie:
|
||||||
|
image: ghcr.io/mealie-recipes/mealie:${MEALIE_VERSION}
|
||||||
|
container_name: mealie
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- mealie-data:/app/data/
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
environment:
|
||||||
|
ALLOW_SIGNUP: "${MEALIE_ALLOW_SIGNUP}"
|
||||||
|
LOG_LEVEL: "${MEALIE_LOGLEVEL}"
|
||||||
|
DB_ENGINE: ${MEALIE_DBENGINE} # Optional: 'sqlite', 'postgres'
|
||||||
|
POSTGRES_USER: ${MEALIE_DB_USER}
|
||||||
|
POSTGRES_PASSWORD: ${MEALIE_DB_PASSWORD}
|
||||||
|
POSTGRES_SERVER: postgres
|
||||||
|
POSTGRES_PORT: 5432
|
||||||
|
POSTGRES_DB: ${MEALIE_DB_NAME}
|
||||||
|
SMTP_HOST=${MEALIE_SMTP_HOST}
|
||||||
|
SMTP_PORT=${MEALIE_SMTP_PORT}
|
||||||
|
SMTP_FROM_NAME=${MEALIE_SMTP_FROM_MAIL}
|
||||||
|
SMTP_AUTH_STRATEGY=${MEALIE_SMTP_AUTH} # Options: 'TLS', 'SSL', 'NONE'
|
||||||
|
SMTP_FROM_EMAIL=${MEALIE_SMTP_FROM_MAIL}
|
||||||
|
SMTP_USER=${MEALIE_SMTP_FROM_MAIL}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik"
|
||||||
|
- "traefik.http.routers.mealie.entrypoints=http"
|
||||||
|
- "traefik.http.routers.mealie.rule=Host(`${MEALIE_DOMAIN}`)"
|
||||||
|
- "traefik.http.middlewares.mealie-https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.routers.mealie.middlewares=mealie-https-redirect"
|
||||||
|
- "traefik.http.routers.mealie-secure.entrypoints=https"
|
||||||
|
- "traefik.http.routers.mealie-secure.rule=Host(`${MEALIE_DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.mealie-secure.tls=true"
|
||||||
|
- "traefik.http.routers.mealie-secure.service=mealie"
|
||||||
|
- "traefik.http.services.mealie.loadbalancer.server.port=9000"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mealie-data:
|
||||||
|
driver: local
|
1
ansible/roles/deploy_container_mealie/vars/main.yml
Normal file
1
ansible/roles/deploy_container_mealie/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
container_base_dir: /opt/docker/mealie
|
Loading…
Add table
Reference in a new issue