system-config/playbooks/roles/lodgeit/templates/docker-compose.yaml.j2
Clark Boylan 69e14c25c8 Log with journald and not syslog in lodgeit docker compose
For some of our containers (including lodgeit) we emit logs to syslog
then have special syslog rules to record container logs into
/var/log/caontainers/. Unfortunately, podman does not support emitting
logs to syslog, but it does support journald. Since our journald setup
on Ubuntu also emits to syslog our existing syslog rules should continue
to work.

Convert lodgeit to journald from syslog to act as a canary as we prepare
for a slow but eventual migration to docker compose + podman as the
management system for our containers.

Change-Id: Ia6ef1c0e932c350f2b029edc7da6cb9e77663e5c
2024-12-12 14:14:49 -08:00

40 lines
1.2 KiB
Django/Jinja

version: '2'
services:
mariadb:
image: docker.io/library/mariadb:10.11
network_mode: host
restart: always
environment:
MYSQL_ROOT_PASSWORD: "{{ lodgeit_db_password }}"
MYSQL_DATABASE: "{{ lodgeit_db_dbname }}"
MYSQL_USER: "{{ lodgeit_db_username }}"
MYSQL_PASSWORD: "{{ lodgeit_db_password }}"
MARIADB_AUTO_UPGRADE: 1
command: [
'--wait_timeout=28800',
]
volumes:
- /var/lib/lodgeit/mariadb:/var/lib/mysql
logging:
driver: journald
options:
tag: "docker-mariadb"
lodgeit:
image: docker.io/opendevorg/lodgeit
depends_on:
- mariadb
restart: always
network_mode: host
user: "10100:10100"
command: ['/bin/bash', '-c', 'echo "*** Starting"; sleep 30; /usr/local/bin/uwsgi']
logging:
driver: journald
options:
tag: "docker-lodgeit"
environment:
LODGEIT_DBURI: 'mysql+pymysql://{{ lodgeit_db_username }}:{{ lodgeit_db_password }}@127.0.0.1:3306/{{ lodgeit_db_dbname }}'
LODGEIT_SECRET_KEY: '{{ lodgeit_secret_key }}'
LODGEIT_TITLE_OVERRIDE: '<img src="/assets/opendev.svg" style="width: 100px; padding-bottom:10px; margin-left:20px;" alt="Opendev Pastebin">'