version: '3.1' services: postgres: build: phpdocker/pg container_name: flibusta_postgres restart: unless-stopped working_dir: /application volumes: - './db:/var/lib/postgresql/data' - './application:/application' environment: - POSTGRES_USER={{ flibusta_db_user }} - POSTGRES_PASSWORD={{ flibusta_db_password }} - POSTGRES_DB={{ flibusta_db_name }} - TZ={{ timezone }} - PUID=999 # PostgreSQL обычно использует UID 999 - PGID=999 ports: - '{{ flibusta_db_port }}:5432' networks: - flibusta_network # Добавляем healthcheck для лучшего контроля healthcheck: test: ["CMD-SHELL", "pg_isready -U {{ flibusta_db_user }}"] interval: 10s timeout: 5s retries: 5 webserver: image: 'nginx:alpine' container_name: flibusta_nginx restart: unless-stopped working_dir: /application volumes: - './application:/application' - './cache:/application/cache' - './Flibusta.Net:/application/flibusta' - './FlibustaSQL/lib.a.attached.zip:/application/cache/lib.a.attached.zip' - './FlibustaSQL/lib.b.attached.zip:/application/cache/lib.b.attached.zip' - './phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf' ports: - '{{ flibusta_web_port }}:80' depends_on: php-fpm: condition: service_started networks: - flibusta_network php-fpm: build: phpdocker/php-fpm container_name: flibusta_php restart: unless-stopped working_dir: /application volumes: - './application:/application' - './cache:/application/cache' - './FlibustaSQL/lib.a.attached.zip:/application/cache/lib.a.attached.zip' - './FlibustaSQL/lib.b.attached.zip:/application/cache/lib.b.attached.zip' - './Flibusta.Net:/application/flibusta' - './FlibustaSQL:/application/sql' - './blob:/application/blob' - './phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini' environment: - TZ={{ timezone }} - PUID=1000 - PGID=1000 depends_on: postgres: condition: service_healthy networks: - flibusta_network networks: flibusta_network: driver: bridge