96 lines
3.8 KiB
YAML
96 lines
3.8 KiB
YAML
services:
|
|
invoice-ninja:
|
|
image: invoiceninja/invoiceninja:5.10.2
|
|
container_name: invoice-ninja
|
|
restart: unless-stopped
|
|
user: 1500:1500
|
|
environment:
|
|
- IN_USER_EMAIL=${INVOICE_NINJA_USER_MAIL}
|
|
- IN_PASSWORD=${INVOICE_NINJA_USER_PASSWORD}
|
|
- APP_URL=http://invoice-ninja-web
|
|
- APP_KEY=${INVOICE_NINJA_APP_KEY}
|
|
- APP_CIPHER=AES-256-CBC
|
|
- DB_HOST=invoice-ninja-db
|
|
- DB_PORT=3306
|
|
- DB_DATABASE=ninja
|
|
- DB_USERNAME=ninja
|
|
- DB_PASSWORD=ninja
|
|
- REQUIRE_HTTPS=false
|
|
- QUEUE_CONNECTION=database
|
|
- IS_DOCKER=TRUE
|
|
volumes:
|
|
- ${APP_DATA_DIR}/data/public:/var/www/app/public:rw,delegated
|
|
- ${APP_DATA_DIR}/data/storage:/var/www/app/storage:rw,delegated
|
|
- ${APP_DATA_DIR}/data/php/php.ini:/usr/local/etc/php/php.ini:ro
|
|
- ${APP_DATA_DIR}/data/php/php-cli.ini:/usr/local/etc/php/php-cli.ini:ro
|
|
depends_on:
|
|
- invoice-ninja-db
|
|
networks:
|
|
- tipi_main_network
|
|
|
|
invoice-ninja-web:
|
|
image: nginx:1.25
|
|
container_name: invoice-ninja-web
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ${APP_DATA_DIR}/data/nginx/invoice-ninja.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- ${APP_DATA_DIR}/data/public:/var/www/app/public:ro
|
|
depends_on:
|
|
invoice-ninja:
|
|
condition: service_started
|
|
ports:
|
|
- ${APP_PORT}:80
|
|
networks:
|
|
- tipi_main_network
|
|
labels:
|
|
# Main
|
|
traefik.enable: true
|
|
traefik.http.middlewares.invoice-ninja-web-redirect.redirectscheme.scheme: https
|
|
traefik.http.services.invoice-ninja.loadbalancer.server.port: 80
|
|
# Web
|
|
traefik.http.routers.invoice-ninja-web-insecure.rule: Host(`${APP_DOMAIN}`)
|
|
traefik.http.routers.invoice-ninja-web-insecure.entrypoints: web
|
|
traefik.http.routers.invoice-ninja-web-insecure.service: invoice-ninja-web
|
|
traefik.http.routers.invoice-ninja-web-insecure.middlewares: invoice-ninja-web-redirect
|
|
# Websecure
|
|
traefik.http.routers.invoice-ninja-web.rule: Host(`${APP_DOMAIN}`)
|
|
traefik.http.routers.invoice-ninja-web.entrypoints: websecure
|
|
traefik.http.routers.invoice-ninja-web.service: invoice-ninja-web
|
|
traefik.http.routers.invoice-ninja-web.tls.certresolver: myresolver
|
|
# Local domain
|
|
traefik.http.routers.invoice-ninja-web-local-insecure.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`)
|
|
traefik.http.routers.invoice-ninja-web-local-insecure.entrypoints: web
|
|
traefik.http.routers.invoice-ninja-web-local-insecure.service: invoice-ninja-web
|
|
traefik.http.routers.invoice-ninja-web-local-insecure.middlewares: invoice-ninja-web-redirect
|
|
# Local domain secure
|
|
traefik.http.routers.invoice-ninja-web-local.rule: Host(`invoice-ninja.${LOCAL_DOMAIN}`)
|
|
traefik.http.routers.invoice-ninja-web-local.entrypoints: websecure
|
|
traefik.http.routers.invoice-ninja-web-local.service: invoice-ninja-web
|
|
traefik.http.routers.invoice-ninja-web-local.tls: true
|
|
|
|
invoice-ninja-db:
|
|
image: mariadb:10.4
|
|
container_name: invoice-ninja-db
|
|
restart: unless-stopped
|
|
environment:
|
|
- MARIADB_ROOT_PASSWORD=${INVOICE_NINJA_BDD_PASSWORD}
|
|
- MARIADB_USER=ninja
|
|
- MARIADB_PASSWORD=ninja
|
|
- MARIADB_DATABASE=ninja
|
|
volumes:
|
|
- ${APP_DATA_DIR}/data/mysql:/var/lib/mysql:rw,delegated
|
|
networks:
|
|
- tipi_main_network
|
|
depends_on:
|
|
invoice-ninja-init:
|
|
condition: service_completed_successfully
|
|
# This command is required to set important mariadb defaults
|
|
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --wait_timeout=28800, --log-warnings=0]
|
|
|
|
invoice-ninja-init:
|
|
image: bash:5.2.26
|
|
container_name: invoice-ninja-init
|
|
volumes:
|
|
- ${APP_DATA_DIR}/data:/tmp/data
|
|
command: bash -c "chmod +x /tmp/data/init/init.sh && /tmp/data/init/init.sh "
|