services: nginx: build: context: . dockerfile: services/nginx/Dockerfile ports: - "80:80" - "443:443" volumes: - ./:/var/www/html:ro - ./services/web/src/offensive/uploads:/var/www/html/offensive/uploads:rw - ./services/web/src/offensive/zips:/var/www/html/offensive/zips:rw - ./services/web/src/offensive/quarantine:/var/www/html/offensive/quarantine:rw - ./services/nginx/certs:/etc/ssl/certs:ro - ./services/nginx/private:/etc/ssl/private:ro depends_on: php: condition: service_healthy realtime: condition: service_started networks: - tmbo-network php: build: context: . dockerfile: services/php/Dockerfile volumes: - ./:/var/www/html - ./services/web/src/offensive/uploads:/var/www/html/offensive/uploads:rw - ./services/web/src/offensive/zips:/var/www/html/offensive/zips:rw - ./services/web/src/offensive/quarantine:/var/www/html/offensive/quarantine:rw - ./admin/.config.generated:/var/www/html/admin/.config:ro environment: - TMBO_ENV=development - SEARCH_DB_DSN=pgsql:host=search-db;dbname=tmbo_search - SEARCH_DB_USER=tmbo_search - SEARCH_DB_PASS=shortbus depends_on: db: condition: service_healthy # started, not healthy: the site runs without search search-db: condition: service_started redis: condition: service_healthy networks: - tmbo-network healthcheck: test: ["CMD-SHELL", "php-fpm -t 2>/dev/null || exit 1"] interval: 30s timeout: 3s retries: 3 start_period: 10s db: # MariaDB, matching production since the PHP 8.4 / MariaDB port. image: mariadb:10.11 command: > --character-set-server=utf8 --collation-server=utf8_general_ci environment: MARIADB_ROOT_PASSWORD: shortbus MARIADB_DATABASE: tmbo MARIADB_USER: tmbo MARIADB_PASSWORD: shortbus volumes: # On first start (empty volume), services/db/init.sh loads schema.sql and # populate.sql from admin/database. - ./services/db/init.sh:/docker-entrypoint-initdb.d/init.sh:ro - ./admin/database:/tmbo-database:ro - mysql_data:/var/lib/mysql ports: - "3307:3306" networks: - tmbo-network healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s timeout: 5s retries: 5 start_period: 30s search-db: # Comment search index (admin/database/search.sql). search-sync fills it # from db; it holds nothing that can't be rebuilt from there. image: postgres:17 environment: POSTGRES_DB: tmbo_search POSTGRES_USER: tmbo_search POSTGRES_PASSWORD: shortbus volumes: - search_data:/var/lib/postgresql/data networks: - tmbo-network healthcheck: test: ["CMD", "pg_isready", "-U", "tmbo_search", "-d", "tmbo_search"] interval: 10s timeout: 5s retries: 5 search-sync: # What cron does in production: copy new comments into search-db every # minute. The first run indexes every comment in db. build: context: . dockerfile: services/cron/Dockerfile # Bundled Predis trips PHP 8.4 deprecation notices on every run; keep the log readable. command: ["sh", "-c", "while :; do php -d 'error_reporting=E_ALL & ~E_DEPRECATED' admin/commentSearchSync.php .; sleep 60; done"] environment: - SEARCH_DB_DSN=pgsql:host=search-db;dbname=tmbo_search - SEARCH_DB_USER=tmbo_search - SEARCH_DB_PASS=shortbus volumes: - ./:/var/www/html:ro - ./admin/.config.generated:/var/www/html/admin/.config:ro depends_on: db: condition: service_healthy search-db: condition: service_healthy networks: - tmbo-network redis: image: redis:7-alpine volumes: - redis_data:/data networks: - tmbo-network healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 3 realtime: build: context: . dockerfile: services/realtime/Dockerfile volumes: - ./admin/.config.generated:/app/admin/.config:ro environment: - NODE_ENV=development # app.js listens on loopback unless told otherwise; nginx is in another container. - REALTIME_HOST=0.0.0.0 depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - tmbo-network cron: build: context: . dockerfile: services/cron/Dockerfile volumes: - ./:/var/www/html - ./services/web/src/offensive/uploads:/var/www/html/offensive/uploads:rw - ./services/web/src/offensive/zips:/var/www/html/offensive/zips:rw - ./services/web/src/offensive/quarantine:/var/www/html/offensive/quarantine:rw - ./admin/.config.generated:/var/www/html/admin/.config:ro depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - tmbo-network profiles: - full volumes: mysql_data: search_data: redis_data: networks: tmbo-network: driver: bridge