Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3b8d2a5b3
|
||
|
|
2dabbc0503
|
||
|
|
1dc092f87f
|
||
|
|
c699983b80
|
||
|
|
7e0847d1c5
|
||
|
|
bc8caf530b
|
||
|
|
2c57e104eb
|
||
|
|
e2ee54f616 | ||
|
|
2278378e30
|
||
|
|
405a9b98dc | ||
|
|
d1bd62529d | ||
|
|
72e6352b71 | ||
|
|
95f8bd6e95 | ||
|
|
32a6a31094
|
||
|
|
0dcd51b601
|
||
|
|
8ccb88503a
|
||
|
|
3f99ea7fcd
|
||
|
|
9904b9a038
|
||
|
|
93c4534204
|
||
|
|
43a8ccff28
|
||
|
|
38a3d44897
|
||
|
|
92ca7f27ab
|
No files matched your search
+16
-2
@@ -13,6 +13,8 @@ traefik_image_traefik: "traefik:v3.2"
|
||||
# to install or not traefik as front-end
|
||||
traefik_install: true
|
||||
|
||||
docker_secrets: []
|
||||
|
||||
# default chill config for each environment
|
||||
default_chill:
|
||||
chill_environment: main_env
|
||||
@@ -21,7 +23,18 @@ default_chill:
|
||||
host: 'devpms.samusocial.be'
|
||||
tls_config: self_signed
|
||||
expose_port: false # can be false, or the port number
|
||||
# use rabbitmq as message broker. If not in use, it will be replaced by doctrine
|
||||
rabbitmq_install: true
|
||||
# mount the directory 'templates' (twig overrides) into the app containers. false = do not mount
|
||||
load_template_override: false
|
||||
proxy_ips:
|
||||
# 127.0.0.1 is always added
|
||||
- 192.168.0.0/16
|
||||
- 10.0.0.0/8
|
||||
- 172.16.0.0/12
|
||||
chill_config:
|
||||
# supplementary environment values to set in the in the env file
|
||||
supplementary_environment_values: {}
|
||||
trusted_hosts: 'devpms.samusocial.be '
|
||||
database_host: '172.17.17.71'
|
||||
database_port: '5432'
|
||||
@@ -43,5 +56,6 @@ default_chill:
|
||||
# jwt_public_key: '1234'
|
||||
rabbitmq_user: 'chilldev'
|
||||
# rabbitmq_password:
|
||||
editor_server: 'https://collabora.samusocial.be'
|
||||
ovhcloud_dsn: 'null://null'
|
||||
editor_server: 'https://collabora.champs-libres.be'
|
||||
ovhcloud_dsn: 'null://null'
|
||||
default_carrier_code: 'FR'
|
||||
+13
-6
@@ -36,20 +36,29 @@
|
||||
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/rabbitmq.env"
|
||||
owner: "{{ as_user }}"
|
||||
mode: '0400'
|
||||
when: chill.rabbitmq_install
|
||||
|
||||
- name: Create directory for storing configuration
|
||||
ansible.builtin.file:
|
||||
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod"
|
||||
state: directory
|
||||
owner: "82"
|
||||
mode: '0500'
|
||||
|
||||
- name: Create directory for template overrides (mounted in the app container)
|
||||
ansible.builtin.file:
|
||||
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/templates"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: "{{ as_user }}"
|
||||
mode: '0400'
|
||||
when: chill.load_template_override
|
||||
|
||||
- name: Copy configuration files
|
||||
ansible.builtin.template:
|
||||
src: "config/prod/{{ file }}"
|
||||
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod/{{ file }}"
|
||||
owner: "{{ as_user }}"
|
||||
mode: '0444'
|
||||
owner: "82"
|
||||
mode: '0400'
|
||||
loop:
|
||||
- lexik_jwt_authentication.yaml
|
||||
- messenger.yaml
|
||||
@@ -62,9 +71,7 @@
|
||||
- name: Create directory for storing data
|
||||
ansible.builtin.file:
|
||||
path: "{{ doc_storage_dir }}/{{ chill['chill_environment'] }}"
|
||||
owner: "82"
|
||||
group: "82"
|
||||
mode: '0766'
|
||||
mode: '0777'
|
||||
state: directory
|
||||
|
||||
# racing condition: on first execution, this is not available...
|
||||
|
||||
+54
-25
@@ -5,33 +5,40 @@ services:
|
||||
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_nginx_name }}:{{ chill.chill_image_tag }}
|
||||
links:
|
||||
- app:php
|
||||
|
||||
{% if traefik_install %}
|
||||
{% if traefik_install %}
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=traefik"
|
||||
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.rule=Host(`{{ chill.host }}`)"
|
||||
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.entrypoints=websecure"
|
||||
{%+ if chill.tls_config == 'self_signed' +%}
|
||||
{% if chill.tls_config == 'self_signed' %}
|
||||
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.tls=true"
|
||||
{%+ endif +%}
|
||||
{%+ if chill.expose_port is not false +%}
|
||||
{% endif %}
|
||||
{% if chill.expose_port is not false %}
|
||||
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.rule=PathPrefix(`/`)"
|
||||
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.entrypoints=chill{{ chill.chill_environment }}"
|
||||
{%+ if chill.tls_config == 'self_signed' +%}
|
||||
{% if chill.tls_config == 'self_signed' %}
|
||||
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.tls=true"
|
||||
{%+ endif +%}
|
||||
{%+ endif +%}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if chill.expose_port is not false %}
|
||||
ports:
|
||||
- "{{ chill.expose_port }}:80"
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
|
||||
{% if traefik_install %}
|
||||
{% if traefik_install %}
|
||||
- traefik
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
- default
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
app: &defaultApp
|
||||
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_php_name }}:{{ chill.chill_image_tag }}
|
||||
@@ -40,19 +47,28 @@ services:
|
||||
volumes:
|
||||
- './config/prod:/var/www/app/config/packages/prod:ro'
|
||||
- '/var/log/chill:/var/www/app/var/log:rw'
|
||||
{% if chill.load_template_override %}
|
||||
- './templates:/var/www/app/templates:ro'
|
||||
{% endif %}
|
||||
- '{{ doc_storage_dir }}/{{ chill['chill_environment'] }}:/var/storage:rw'
|
||||
links:
|
||||
- redis
|
||||
- relatorio
|
||||
{% if chill.rabbitmq_install %}
|
||||
- rabbitmq
|
||||
|
||||
{% if chill.add_postgres -%}
|
||||
{% endif %}
|
||||
{% if chill.add_postgres %}
|
||||
- database
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
- default
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "3"
|
||||
|
||||
consumer:
|
||||
<<: *defaultApp
|
||||
@@ -62,11 +78,11 @@ services:
|
||||
command:
|
||||
- "/bin/bash"
|
||||
- "-c"
|
||||
- >
|
||||
- >
|
||||
sleep 3 && bin/console cache:clear &&
|
||||
while ! [ -f /tmp/kill_me ];
|
||||
do
|
||||
su -s /bin/bash -c 'php -d memory_limit=2G bin/console messenger:consume priority async --limit=20 --time-limit=600 -v' "www-data";
|
||||
php -d memory_limit=3G bin/console messenger:consume priority async --limit=40 --time-limit=600 -v;
|
||||
done;
|
||||
pre_stop:
|
||||
- command:
|
||||
@@ -79,8 +95,7 @@ services:
|
||||
entrypoint: "/usr/bin/env"
|
||||
command: ["bin/console", "chill:cron-job:execute", "-v"]
|
||||
restart: "no"
|
||||
|
||||
{% if chill.add_postgres %}
|
||||
{% if chill.add_postgres %}
|
||||
|
||||
database:
|
||||
image: "{{ database_image }}"
|
||||
@@ -91,8 +106,7 @@ services:
|
||||
networks:
|
||||
- default
|
||||
restart: always
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
###> chill-project/chill-bundles ###
|
||||
redis:
|
||||
@@ -100,12 +114,22 @@ services:
|
||||
networks:
|
||||
- default
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
relatorio:
|
||||
image: "{{ chill_image_relatorio }}"
|
||||
networks:
|
||||
- default
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
###< chill-project/chill-bundles ###
|
||||
|
||||
# sign-worker:
|
||||
@@ -131,7 +155,7 @@ services:
|
||||
# depends_on:
|
||||
# rabbitmq:
|
||||
# condition: service_healthy
|
||||
|
||||
{% if chill.rabbitmq_install %}
|
||||
rabbitmq:
|
||||
image: "{{ chill_image_rabbitmq }}"
|
||||
env_file:
|
||||
@@ -144,12 +168,17 @@ services:
|
||||
networks:
|
||||
- default
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
|
||||
{% if traefik_install %}
|
||||
{% if traefik_install %}
|
||||
traefik:
|
||||
external: true
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
default:
|
||||
@@ -1,7 +1,11 @@
|
||||
# this file is managed by ansible. Do not edit it by hand
|
||||
|
||||
framework:
|
||||
{% if traefik_install %}
|
||||
trusted_proxies: '127.0.0.1,REMOTE_ADDR{% for ip in traefik_trusted_ips|default([]) %},{{ ip }}{% endfor %}'
|
||||
{% else %}
|
||||
trusted_proxies: '127.0.0.1,{% for ip in chill.proxy_ips %}{{ ip }}{% if not loop.last %},{% endif %}{% endfor %}'
|
||||
{% endif %}
|
||||
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port']
|
||||
|
||||
parameters:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
framework:
|
||||
messenger:
|
||||
transports:
|
||||
{% if chill.rabbitmq_install %}
|
||||
async:
|
||||
dsn: '%env(RABBITMQ_URL)%/async'
|
||||
options:
|
||||
@@ -12,5 +13,9 @@ framework:
|
||||
async: ~
|
||||
auto_setup: true
|
||||
priority: '%env(RABBITMQ_URL)%/priority'
|
||||
{% else %}
|
||||
async: 'doctrine://default'
|
||||
priority: 'doctrine://default'
|
||||
{% endif %}
|
||||
failed: 'doctrine://default?queue_name=failed'
|
||||
sync: 'sync://'
|
||||
sync: 'sync://'
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
|
||||
parameters:
|
||||
log_prefix: 'test'
|
||||
log_prefix: '{{ chill.chill_environment }}'
|
||||
monolog:
|
||||
# make a "notifier" channel available
|
||||
channels: ['notifier']
|
||||
@@ -16,6 +16,10 @@ monolog:
|
||||
path: "%kernel.logs_dir%/notifier-%log_prefix%.log"
|
||||
level: info
|
||||
channels: [ 'notifier' ]
|
||||
errors_log:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/error-%log_prefix%.log"
|
||||
level: error
|
||||
privacy_log:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/privacy-%log_prefix%.log"
|
||||
@@ -25,9 +29,15 @@ monolog:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/default-%log_prefix%.log"
|
||||
level: info
|
||||
channels: [ '!event', '!doctrine', '!console', '!chill',]
|
||||
channels: [ '!event', '!doctrine', '!console', '!chill', '!deprecation']
|
||||
deprecation_log:
|
||||
type: 'null'
|
||||
channels: [ 'deprecation' ]
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: [ '!event', '!doctrine', '!console']
|
||||
level: error
|
||||
channels: [ '!event', '!doctrine', '!console', '!deprecation']
|
||||
bubble: true
|
||||
|
||||
|
||||
+12
-1
@@ -24,7 +24,7 @@ NOTIFICATION_FROM_EMAIL={{ chill.chill_config.notification_from_email }}
|
||||
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
||||
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||
DEFAULT_CARRIER_CODE=FR
|
||||
DEFAULT_CARRIER_CODE={{ chill.chill_config.default_carrier_code }}
|
||||
APP_SECRET={{ chill.chill_config.app_secret }}
|
||||
ADMIN_PASSWORD={{ chill.chill_config.admin_password }}
|
||||
{% if chill.chill_config.admin_password_1 is defined -%}
|
||||
@@ -36,12 +36,23 @@ ADMIN_PASSWORD_2={{ chill.chill_config.admin_password_2 }}
|
||||
{% if chill.chill_config.admin_password_3 is defined -%}
|
||||
ADMIN_PASSWORD_3={{ chill.chill_config.admin_password_3 }}
|
||||
{% endif -%}
|
||||
{% if chill.chill_config.admin_password_4 is defined -%}
|
||||
ADMIN_PASSWORD_4={{ chill.chill_config.admin_password_4 }}
|
||||
{% endif -%}
|
||||
{% if chill.chill_config.admin_password_5 is defined -%}
|
||||
ADMIN_PASSWORD_5={{ chill.chill_config.admin_password_5 }}
|
||||
{% endif -%}
|
||||
MAILER_DSN={{ chill.chill_config.mailer_dsn }}
|
||||
MAILER_URL={{ chill.chill_config.mailer_url }}
|
||||
JWT_PASSPHRASE={{ chill.chill_config.jwt_passphrase }}
|
||||
JWT_SECRET_KEY={{ chill.chill_config.jwt_secret_key }}
|
||||
JWT_PUBLIC_KEY={{ chill.chill_config.jwt_public_key }}
|
||||
{% if chill.rabbitmq_install %}
|
||||
RABBITMQ_URL=amqp://{{ chill.chill_config.rabbitmq_user }}:{{ chill.chill_config.rabbitmq_password }}@rabbitmq/%2f
|
||||
{% endif %}
|
||||
DATABASE_URL=postgres://{{ chill.chill_config.database_user }}:{{ chill.chill_config.database_password }}@{% if chill.add_postgres %}database:5432{% else %}{{ chill.chill_config.database_host }}{% endif %}/{{ chill.chill_config.database_name }}?sslmode=prefer&charset=utf8&serverVersion={{ chill.chill_config.database_version }}
|
||||
EDITOR_SERVER={{ chill.chill_config.editor_server }}
|
||||
OVHCLOUD_DSN={{ chill.chill_config.ovhcloud_dsn }}
|
||||
{% for k, v in chill.chill_config.supplementary_environment_values.items() %}
|
||||
{{ k }}="{{ v }}"
|
||||
{% endfor %}
|
||||
@@ -1,26 +1,17 @@
|
||||
/var/log/chill/default-*.log {
|
||||
/var/log/chill/*.log {
|
||||
su php-fpm php-fpm
|
||||
rotate 90
|
||||
daily
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
copytruncate
|
||||
rotate 90
|
||||
}
|
||||
|
||||
/var/log/chill/privacy-*.log {
|
||||
su php-fpm php-fpm
|
||||
rotate 180
|
||||
daily
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
}
|
||||
|
||||
/var/log/chill/notifier-*.log {
|
||||
su php-fpm php-fpm
|
||||
rotate 800
|
||||
daily
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# this file is managed by ansible. Do not edit it by hand
|
||||
POSTGRES_DB={{ item.chill_config.database_name }}
|
||||
POSTGRES_USER={{ item.chill_config.database_user }}
|
||||
POSTGRES_PASSWORD={{ item.chill_config.database_password }}
|
||||
POSTGRES_DB={{ chill.chill_config.database_name }}
|
||||
POSTGRES_USER={{ chill.chill_config.database_user }}
|
||||
POSTGRES_PASSWORD={{ chill.chill_config.database_password }}
|
||||
@@ -1,3 +1,3 @@
|
||||
# this file is managed by ansible. Do not edit it by hand.
|
||||
RABBITMQ_DEFAULT_USER={{ item.chill_config.rabbitmq_user }}
|
||||
RABBITMQ_DEFAULT_PASS={{ item.chill_config.rabbitmq_password }}
|
||||
RABBITMQ_DEFAULT_USER={{ chill.chill_config.rabbitmq_user }}
|
||||
RABBITMQ_DEFAULT_PASS={{ chill.chill_config.rabbitmq_password }}
|
||||
@@ -3,7 +3,7 @@ Description=Execute send-short-messages for chill with environment %i
|
||||
|
||||
[Service]
|
||||
User={{ as_user }}
|
||||
ExecStart=/usr/bin/docker compose --file {{ install_dir }}/%i/compose.yaml run cron bin/console chill:calendar:send-short-messages
|
||||
ExecStart=/usr/bin/docker compose --file {{ install_dir }}/%i/compose.yaml run --rm cron bin/console chill:calendar:send-short-messages
|
||||
Type=simple
|
||||
# execute maximum 30 minutes
|
||||
RuntimeMaxSec=1800
|
||||
Reference in new issue
Block a user