Advertisement
fffetaah

Untitled

Apr 1st, 2025
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.10 KB | None | 0 0
  1.  
  2.  
  3. services:
  4.   yeda.traefik:
  5.     image: traefik:v3.0
  6.     container_name: yeda.traefik
  7.     networks:
  8.      - yeda_php_network
  9.     depends_on:
  10.      - yeda.nginx
  11.     restart: always
  12.     ports:
  13.      - "80:80"
  14.       - "443:443"
  15.     volumes:
  16.      - /var/run/docker.sock:/var/run/docker.sock:ro
  17.       - ../yeda-data/letsencrypt:/letsencrypt
  18.       - ../yeda-data/.htpasswd:/auth/.htpasswd:ro
  19.     labels:
  20.      - "traefik.enable=true"
  21.       - "traefik.http.routers.api.rule=Host(`traefik.yeda-college.co.il`)"
  22.       - "traefik.http.routers.api.entrypoints=websecure"
  23.       - "traefik.http.routers.api.tls.certresolver=letsencrypt"
  24.       - "traefik.http.routers.api.service=api@internal"
  25.       - "com.datadoghq.ad.logs: '[{\"source\": \"traefik\", \"service\": \"traefik\"}]'"
  26.    command:
  27.      - --entrypoints.web.address=:80
  28.      - --entrypoints.websecure.address=:443
  29.      - --api=true
  30.      - --providers.docker=true
  31.      - --providers.docker.exposedbydefault=false
  32.      - --certificatesresolvers.letsencrypt.acme.httpchallenge=true
  33.      - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
  34.      - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
  35.      - --accesslog=true
  36.  yeda.php-fpm:
  37.    container_name: yeda.php-fpm
  38.    healthcheck:
  39.      test: [ "CMD-SHELL", "php-fpm -t" ]
  40.      interval: 10s
  41.      timeout: 3s
  42.      retries: 3
  43.    command: ["php-fpm", "-F"]
  44.    build:
  45.      context: .
  46.      dockerfile: php/Dockerfile.php-fpm
  47.    depends_on:
  48.      - yeda.postgres
  49.      - yeda.redis
  50.    restart: always
  51.    env_file:
  52.      - .env
  53.    volumes:
  54.      - ./php/php-fpm.d:/usr/local/etc/php-fpm.d
  55.      - ./php/php.ini:/usr/local/etc/php/php.ini
  56.      - ../yeda-php:/var/www/html
  57.      - php_fpm_socket:/run/php
  58.    networks:
  59.      - yeda_php_network
  60.  
  61.  yeda.nginx:
  62.    container_name: yeda.nginx
  63.    labels:
  64.      - "traefik.enable=true"
  65.      - "traefik.http.routers.yeda.rule=Host(`new.yeda-college.co.il`)"
  66.      - "traefik.http.routers.yeda.entrypoints=websecure"
  67.      - "traefik.http.routers.yeda.tls.certresolver=letsencrypt"
  68.      - "traefik.http.services.yeda.loadbalancer.server.port=80"
  69.  
  70.      - "traefik.http.routers.yeda-http.entrypoints=web"
  71.      - "traefik.http.routers.yeda-http.rule=Host(`new.yeda-college.co.il`)"
  72.      - "traefik.http.routers.yeda-http.middlewares=https-redirect"
  73.      - "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
  74.      - "com.datadoghq.ad.logs: '[{\"source\": \"nginx\", \"service\": \"nginx\"}]'"
  75.    build:
  76.      context: .
  77.      dockerfile: nginx/Dockerfile
  78.    restart: always
  79.    depends_on:
  80.      yeda.php-fpm:
  81.        condition: service_healthy
  82.  
  83.    volumes:
  84.      - ./nginx/templates:/etc/nginx/templates
  85.      - ../yeda-php:/var/www/html
  86.      - ../yeda-data/certs:/etc/ssl/certs
  87.      - php_fpm_socket:/run/php
  88.    networks:
  89.      - yeda_php_network
  90.  
  91.  yeda.postgres:
  92.    image: postgres:latest
  93.    container_name: yeda.postgres
  94.    labels:
  95.      - "com.datadoghq.ad.logs: '[{\"source\": \"postgresql\", \"service\": \"postgres\"}]'"
  96.    restart: always
  97.    #ports needed only for migration, remove after full migration from DO to HZ
  98.    ports:
  99.      - "5432:5432"
  100.    env_file:
  101.      - .env
  102.    volumes:
  103.      - ../yeda-data/postgres:/var/lib/postgresql/data
  104.    environment:
  105.      POSTGRES_DB: ${POSTGRES_DB}
  106.      POSTGRES_USER: ${POSTGRES_USER}
  107.      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
  108.      TZ: UTC
  109.    healthcheck:
  110.      test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
  111.      interval: 30s
  112.      timeout: 5s
  113.      retries: 5
  114.    networks:
  115.      - yeda_php_network
  116.    command:
  117.      - "postgres"
  118.      - "-c"
  119.      - "max_connections=200"
  120.      - "-c"
  121.      - "shared_buffers=15GB"
  122.      - "-c"
  123.      - "effective_cache_size=45GB"
  124.      - "-c"
  125.      - "maintenance_work_mem=2GB"
  126.      - "-c"
  127.      - "checkpoint_completion_target=0.9"
  128.      - "-c"
  129.      - "wal_buffers=16MB"
  130.      - "-c"
  131.      - "default_statistics_target=100"
  132.      - "-c"
  133.      - "random_page_cost=1.1"
  134.      - "-c"
  135.      - "effective_io_concurrency=200"
  136.      - "-c"
  137.      - "work_mem=19660kB"
  138.      - "-c"
  139.      - "huge_pages=try"
  140.      - "-c"
  141.      - "min_wal_size=1GB"
  142.      - "-c"
  143.      - "max_wal_size=4GB"
  144.      - "-c"
  145.      - "max_worker_processes=30"
  146.      - "-c"
  147.      - "max_parallel_workers_per_gather=4"
  148.      - "-c"
  149.      - "max_parallel_workers=30"
  150.      - "-c"
  151.      - "max_parallel_maintenance_workers=4"
  152.  
  153.  yeda.redis:
  154.    image: redis:latest
  155.    container_name: yeda.redis
  156.    restart: always
  157.    volumes:
  158.      - ../data/redis:/data
  159.    healthcheck:
  160.      test: ["CMD", "redis-cli", "ping"]
  161.      interval: 30s
  162.      timeout: 10s
  163.      retries: 5
  164.    networks:
  165.      - yeda_php_network
  166.  
  167.  yeda.queue-worker:
  168.    image: ghcr.io/yeda-colleges/yeda-php-cli:8.2
  169.    container_name: yeda.queue-workers
  170.    labels:
  171.      - "com.datadoghq.ad.logs: '[{\"source\": \"php\", \"service\": \"laravel-worker\"}]'"
  172.    restart: always
  173.    depends_on:
  174.      - yeda.redis
  175.      - yeda.postgres
  176.    env_file:
  177.      - .env
  178.    volumes:
  179.      - ../yeda-php:/var/www/html
  180.    command: php /var/www/html/artisan queue:work --timeout=90 --memory=1000 --tries=3
  181.    deploy:
  182.      replicas: 1
  183.    networks:
  184.      - yeda_php_network
  185.  
  186.  yeda.scheduler:
  187.    container_name: yeda.scheduler
  188.    labels:
  189.      - "com.datadoghq.ad.logs: '[{\"source\": \"php\", \"service\": \"laravel-scheduler\"}]'"
  190.    image: ghcr.io/yeda-colleges/yeda-php-cli:8.2
  191.    restart: always
  192.    env_file:
  193.      - .env
  194.    volumes:
  195.      - ../yeda-php:/var/www/html
  196.    entrypoint: ["/bin/sh", "-c", "while :; do php /var/www/html/artisan schedule:run; sleep 60; done"]
  197.    networks:
  198.      - yeda_php_network
  199.  
  200.  yeda.composer:
  201.    container_name: yeda.composer
  202.    build:
  203.      context: .
  204.      dockerfile: ./php/Dockerfile.composer
  205.    volumes:
  206.      - ../yeda-php:/var/www/html
  207.    working_dir: /var/www/html
  208.    command: composer install --optimize-autoloader --no-dev
  209.    networks:
  210.      - yeda_php_network
  211.  
  212.  datadog:
  213.    image: gcr.io/datadoghq/agent:latest
  214.    depends_on:
  215.      - yeda.nginx
  216.      - yeda.php-fpm
  217.      - yeda.queue-worker
  218.      - yeda.scheduler
  219.      - yeda.traefik
  220.    container_name: datadog
  221.    restart: always
  222.    env_file:
  223.      - .env
  224.    environment:
  225.      DD_API_KEY: ${DD_API_KEY}
  226.      DD_SITE: datadoghq.eu
  227.      DD_APM_ENABLED: "true"
  228.      DD_LOGS_ENABLED: "true"
  229.      DD_PROCESS_AGENT_ENABLED: "true"
  230.      DD_DOGSTATSD_NON_LOCAL_TRAFFIC: "true"
  231.      DD_CONTAINER_EXCLUDE: "name:datadog"
  232.      DD_PROCESS_CONFIG_ENABLED: "true"
  233.      DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED: "true"
  234.      DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL: "true"
  235.      DD_CONTAINER_LOGS_ENABLED: "true"
  236.    volumes:
  237.      - /var/run/docker.sock:/var/run/docker.sock:ro
  238.      - /proc/:/host/proc/:ro
  239.      - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
  240.    networks:
  241.      - yeda_php_network
  242.  
  243. volumes:
  244.  php_fpm_socket:
  245.  
  246. networks:
  247.  yeda_php_network:
  248.    driver: bridge
  249.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement