diff --git a/apps/calibre-web.yml b/apps/calibre-web.yml new file mode 100644 index 0000000..b2e93ac --- /dev/null +++ b/apps/calibre-web.yml @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Title: PGBlitz (calibre-web) +# Author(s): Sejrup +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'calibre-web' + intport: '8083' + extport: '8083' + image: 'technosoft2000/calibre-web' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/coreapps/apps/_core.yml' + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + pg_labels: + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.auth.forward.address: '{{gauth}}' + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}:/books' + - '/opt/appdata/{{pgrole}}/config:/calibre-web/config' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + USE_CONFIG_DIR: 'true' + SET_CONTAINER_TIMEZONE: 'true' + CONTAINER_TIMEZONE: 'Europe/Copenhagen' + PUID: '1000' + PGID: '1000' + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: always + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}'