# # Docker service definitions for the aurweb project. # # Notable services: # - `sharness` - Run sharness test suites # - `pytest-mysql` - Run pytest suites with MariaDB # - `pytest-sqlite` - Run pytest suites with SQLite # - `test` - Run sharness, pytest-mysql and pytest-sqlite # - `mariadb` - `port 13306` - MariaDB server for docker # # Copyright (C) 2021 aurweb Development # All Rights Reserved. version: "3.8" services: mariadb: image: aurweb:latest init: true entrypoint: /docker/mariadb-entrypoint.sh command: /docker/scripts/run-mariadb.sh mysqld_safe --datadir=/var/lib/mysql ports: # This will expose mariadbd on 127.0.0.1:13306 in the host. # Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb` - "13306:3306" volumes: - mariadb_run:/var/run/mysqld # Bind socket in this volume. - mariadb_data:/var/lib/mysql healthcheck: test: "bash /docker/health/mariadb.sh" interval: 2s timeout: 60s sharness: image: aurweb:latest init: true environment: - AUR_CONFIG=conf/config.sqlite entrypoint: /docker/test-sqlite-entrypoint.sh command: /docker/scripts/run-sharness.sh volumes: - ./cache:/cache pytest-mysql: image: aurweb:latest init: true environment: - AUR_CONFIG=conf/config entrypoint: /docker/test-mysql-entrypoint.sh command: /docker/scripts/run-pytests.sh clean depends_on: mariadb: condition: service_healthy links: - mariadb volumes: - mariadb_run:/var/run/mysqld - ./cache:/cache pytest-sqlite: image: aurweb:latest init: true environment: - AUR_CONFIG=conf/config.sqlite entrypoint: /docker/test-sqlite-entrypoint.sh command: /docker/scripts/run-pytests.sh clean volumes: - mariadb_run:/var/run/mysqld - ./cache:/cache test: image: aurweb:latest init: true environment: - AUR_CONFIG=conf/config entrypoint: /docker/tests-entrypoint.sh command: /docker/scripts/run-tests.sh depends_on: mariadb: condition: service_healthy links: - mariadb volumes: - mariadb_run:/var/run/mysqld - ./cache:/cache volumes: mariadb_run: {} # Share /var/run/mysqld/mysqld.sock mariadb_data: {} # Share /var/lib/mysql