Ctrl K
ComunidadGuías…

docker-compose.prod.yml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
services:
  # Placeholder for "soketi" overrides in docker-compose.custom.yml from versions before 4.4.
  # Realtime runs inside the coolify container now. Without this entry, such an override is an
  # incomplete service and every upgrade fails. Zero replicas means it never starts, and
  # "docker compose up" removes the old coolify-realtime container (an inactive profile keeps it).
  # It uses the coolify image, so install and upgrade do not pull another image.
  soketi:
    image: "${REGISTRY_URL:-docker.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}"
    deploy:
      replicas: 0
  coolify:
    image: "${REGISTRY_URL:-docker.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}"
    volumes:
      - type: bind
        source: /data/coolify/source/.env
        target: /var/www/html/.env
        read_only: true
      - /data/coolify/ssh:/var/www/html/storage/app/ssh
      - /data/coolify/applications:/var/www/html/storage/app/applications
      - /data/coolify/databases:/var/www/html/storage/app/databases
      - /data/coolify/services:/var/www/html/storage/app/services
      - /data/coolify/backups:/var/www/html/storage/app/backups
      - /data/coolify/images:/var/www/html/storage/app/images
    environment:
      - APP_ENV=${APP_ENV:-production}
      - PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-256M}
      - PHP_FPM_PM_CONTROL=${PHP_FPM_PM_CONTROL:-dynamic}
      - PHP_FPM_PM_START_SERVERS=${PHP_FPM_PM_START_SERVERS:-1}
      - PHP_FPM_PM_MIN_SPARE_SERVERS=${PHP_FPM_PM_MIN_SPARE_SERVERS:-1}
      - PHP_FPM_PM_MAX_SPARE_SERVERS=${PHP_FPM_PM_MAX_SPARE_SERVERS:-10}
      - PUSHER_BACKEND_PORT=${PUSHER_BACKEND_PORT:-6001}
    env_file:
      - /data/coolify/source/.env
    ports:
      - "${APP_PORT:-8000}:8080"
      - "${REVERB_PORT:-${SOKETI_PORT:-6001}}:6001"
      - "6002:6002"
    expose:
      - "${APP_PORT:-8000}"
      - "6001"
      - "6002"
    networks:
      coolify:
        # Realtime ran in the coolify-realtime container before 4.4; keep the name for existing proxy upstreams.
        aliases:
          - coolify-realtime
    healthcheck:
      test: curl --fail http://127.0.0.1:8080/api/health && curl --fail http://127.0.0.1:${PUSHER_BACKEND_PORT:-6001}/up || exit 1
      interval: 5s
      retries: 24
      start_period: 1m
      timeout: 2s
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
  postgres:
    volumes:
      - coolify-db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: "${DB_USERNAME}"
      POSTGRES_PASSWORD: "${DB_PASSWORD}"
      POSTGRES_DB: "${DB_DATABASE:-coolify}"
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME}", "-d", "${DB_DATABASE:-coolify}" ]
      interval: 5s
      retries: 10
      timeout: 2s
  redis:
    command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
    environment:
      REDIS_PASSWORD: "${REDIS_PASSWORD}"
    volumes:
      - coolify-redis:/data
    healthcheck:
      test: redis-cli ping
      interval: 5s
      retries: 10
      timeout: 2s
volumes:
  coolify-db:
    name: coolify-db
  coolify-redis:
    name: coolify-redis

networks:
  coolify:
    external: true