infrastructure/playbooks/roles/phpvms/defaults/main.yml

179 lines
5 KiB
YAML

---
phpvms_version: 7.0.5
phpvms_docker_image: ghcr.io/phpvms/phpvms:{{ phpvms_version }}-gd
phpvms_uid: 1000
phpvms_gid: 1000
phpvms_app_key: "{{ undef() }}"
phpvms_svc:
domain: "kondor-virtual.de"
port: 80
phpvms_env:
WWWUSER: "{{ phpvms_uid }}"
WWWGROUP: "{{ phpvms_gid }}"
CADDY_DOMAIN: "http://{{ svc.domain }}"
APP_KEY: "{{ phpvms_app_key | mandatory }}"
APP_NAME: phpVMS
SITE_NAME: phpVMS
APP_URL: "https://{{ svc.domain }}"
APP_LOCALE: de
APP_ENV: production
LOG_LEVEL: debug
APP_DEBUG: false
DEBUG_TOOLBAR: false
## DATABASE SETTINGS
DB_CONNECTION: mysql
DB_HOST: mariadb
DB_PORT: 3306
DB_DATABASE: phpvms
DB_USERNAME: phpvms
DB_PASSWORD: "{{ vault_phpvms.db.pass }}"
## CACHE SETTINGS
CACHE_DRIVER: redis
REDIS_URL: redis
REDIS_HOST: redis
REDIS_PORT: 6379
## EMAIL SETTINGS
MAIL_MAILER: smtp
MAIL_HOST: "{{ mailer.host }}"
MAIL_PORT: "{{ mailer.port }}"
MAIL_USERNAME: "{{ opentofu.mailcow_data.phpvms.address }}"
MAIL_PASSWORD: "{{ opentofu.mailcow_data.phpvms.password }}"
MAIL_ENCRYPTION: tls
MAIL_FROM_ADDRESS: "{{ opentofu.mailcow_data.phpvms.address }}"
MAIL_FROM_NAME: "${APP_NAME}"
## QUEUE SETTINGS
# Set this to "database" if you have slow pages due to notifications/emails
# They will then be sent out via cron
QUEUE_DRIVER: database
# If youre using the Laravel Queue Worker, set this to true. This will stop the queue tasks
# from being run during the cron job
# https://laravel.com/docs/8.x/queues#running-the-queue-worker
QUEUE_WORKER: true
# Whether to prefetch the data in the admin panel
# This will speed up the admin panel, but will use more bandwidth
# See https://filamentphp.com/docs/4.x/panel-configuration#enabling-spa-prefetching
USE_PREFETCHING_IN_ADMIN: false
phpvms_compose:
watchtower: false
image: caddy:2
volumes:
- ./public/:/var/www/html/public:ro
- ./Caddyfile:/etc/caddy/Caddyfile:ro
file:
services:
phpvms-app:
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: "{{ phpvms_docker_image }}"
restart: always
command: sh -c sed -i
's/Paginator::useBootstrap();/Paginator::useBootstrap();
\\\\Illuminate\\\\Support\\\\Facades\\\\URL::forceScheme(\"https\");/'
app/Providers/AppServiceProvider.php && php-fpm
environment:
PHP_OPCACHE_ENABLE: 1
# some basic laravel stuff
AUTORUN_ENABLED: 1
env_file: .env
volumes:
- ./public/:/var/www/html/public:rw
- ./modules:/var/www/html/modules:ro
- ./public/uploads:/var/www/html/public/uploads:rw
- ./storage:/var/www/html/storage:rw
depends_on:
- mariadb
- redis
networks:
default:
task:
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: "{{ phpvms_docker_image }}"
restart: always
command: ["php", "/var/www/html/artisan", "schedule:work"]
environment:
PHP_OPCACHE_ENABLE: 1
healthcheck:
# This is our native healthcheck script for the scheduler
test: ["CMD", "healthcheck-schedule"]
start_period: 10s
env_file: .env
volumes:
- ./modules:/var/www/html/modules:ro
- ./public/uploads:/var/www/html/public/uploads:rw
- ./storage:/var/www/html/storage:rw
networks:
default:
queue:
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: "{{ phpvms_docker_image }}"
restart: always
command: ["php", "/var/www/html/artisan", "queue:work", "--tries=3"]
environment:
PHP_OPCACHE_ENABLE: 1
healthcheck:
# This is our native healthcheck script for the queue
test: ["CMD", "healthcheck-queue"]
start_period: 10s
env_file: .env
volumes:
- ./modules:/var/www/html/modules:ro
- ./public/uploads:/var/www/html/public/uploads:rw
- ./storage:/var/www/html/storage:rw
networks:
default:
mariadb:
container_name: phpvms-mariadb
image: mariadb:11
restart: always
# If someone need to access db from the outside
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'no'
volumes:
- mariadb:/var/lib/mysql
networks:
default:
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
redis:
container_name: phpvms-redis
image: redis:alpine
restart: always
networks:
default:
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
volumes:
mariadb: