homelab/tasks/invoiceninja.yml

96 lines
3.1 KiB
YAML
Raw Normal View History

2024-09-09 22:37:51 +10:00
---
- name: Create directories
file:
path: "{{ item }}"
state: directory
with_items:
2024-09-10 22:09:43 +10:00
- "{{ data_folder }}/invoiceninja/"
- "{{ data_folder }}/invoiceninja/config"
- "{{ data_folder }}/invoiceninja/db"
2024-09-09 22:37:51 +10:00
- name: "create stack.env"
copy:
2024-09-10 22:09:43 +10:00
dest: "{{ data_folder }}/invoiceninja/stack.env"
2024-09-09 22:37:51 +10:00
content: |
APP_NAME="Invoice Ninja"
APP_ENV=production
APP_KEY="{{ IN_APP_KEY }}"
APP_DEBUG=false
APP_URL="{{ IN_APP_URL }}"
REQUIRE_HTTPS=true
TRUSTED_PROXIES='*'
SESSION_ENCRYPT=false
SESSION_SECURE=false
DB_CONNECTION="mysql"
MULTI_DB_ENABLED=false
DB_HOST="{{MYSQL_HOST}}"
DB_DATABASE="{{IN_DB_DATABASE}}"
DB_USERNAME="{{IN_DB_USERNAME}}"
DB_PASSWORD="{{IN_DB_PASSWORD}}"
DB_PORT="3306"
DEMO_MODE=false
BROADCAST_DRIVER=log
LOG_CHANNEL=stack
CACHE_DRIVER=file
#QUEUE_CONNECTION=sync
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER="smtp"
MAIL_HOST="{{MAIL_HOST}}"
MAIL_PORT="{{MAIL_PORT}}"
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS="{{MAIL_FROM}}"
MAIL_FROM_NAME="{{MAIL_FROM_NAME}}"
POSTMARK_API_TOKEN=
GOOGLE_MAPS_API_KEY=
ERROR_EMAIL=
NINJA_ENVIRONMENT="selfhost"
#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
PHANTOMJS_SECRET=secret
UPDATE_SECRET=secret
SENTRY_LARAVEL_DSN=https://32f01ea994744fa08a0f688769cef78a@sentry.invoicing.co/
- name: Create the invoiceninja-app container
docker_container:
name: invoiceninja-app
image: invoiceninja/invoiceninja:5
2024-09-10 22:09:43 +10:00
env_file: "{{ data_folder }}/invoiceninja/stack.env"
2024-09-09 22:37:51 +10:00
restart_policy: unless-stopped
recreate: true
networks:
- name: proxy
volumes:
2024-09-10 22:09:43 +10:00
- "{{ data_folder }}/invoiceninja/config/hosts:/etc/hosts"
- "{{ data_folder }}/invoiceninja/docker/app/public:/var/www/app/public"
- "{{ data_folder }}/invoiceninja/docker/app/storage:/var/www/app/storage"
2024-09-09 22:37:51 +10:00
- name: Create the invoiceninja-nginx container
docker_container:
name: invoiceninja-nginx
image: nginx:1.27.2
2024-09-10 22:09:43 +10:00
env_file: "{{ data_folder }}/invoiceninja/stack.env"
2024-09-09 22:37:51 +10:00
restart_policy: unless-stopped
recreate: true
networks:
- name: proxy
volumes:
2024-09-10 22:09:43 +10:00
- "{{ data_folder }}/invoiceninja/config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf"
- "{{ data_folder }}/invoiceninja/docker/app/public:/var/www/app/public"
- "{{ data_folder }}/invoiceninja/docker/app/storage:/var/www/app/storage"
2024-09-09 22:37:51 +10:00
labels:
traefik.enable: "true"
traefik.http.routers.invoiceninja.rule: "Host(`invoice.comprofix.com`)"
traefik.http.routers.invoiceninja.entrypoints: "https"
traefik.http.routers.invoiceninja.tls: "true"
traefik.http.services.invoiceninja.loadbalancer.server.port: "80"
traefik.http.services.invoiceninja.loadbalancer.server.scheme: "http"