Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services:
- yeda.traefik:
- image: traefik:v3.0
- container_name: yeda.traefik
- networks:
- - yeda_php_network
- depends_on:
- - yeda.nginx
- restart: always
- ports:
- - "80:80"
- - "443:443"
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock:ro
- - ../yeda-data/letsencrypt:/letsencrypt
- - ../yeda-data/.htpasswd:/auth/.htpasswd:ro
- labels:
- - "traefik.enable=true"
- - "traefik.http.routers.api.rule=Host(`traefik.yeda-college.co.il`)"
- - "traefik.http.routers.api.entrypoints=websecure"
- - "traefik.http.routers.api.tls.certresolver=letsencrypt"
- - "traefik.http.routers.api.service=api@internal"
- - "com.datadoghq.ad.logs: '[{\"source\": \"traefik\", \"service\": \"traefik\"}]'"
- command:
- - --entrypoints.web.address=:80
- - --entrypoints.websecure.address=:443
- - --api=true
- - --providers.docker=true
- - --providers.docker.exposedbydefault=false
- - --certificatesresolvers.letsencrypt.acme.httpchallenge=true
- - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
- - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
- - --accesslog=true
- yeda.php-fpm:
- container_name: yeda.php-fpm
- healthcheck:
- test: [ "CMD-SHELL", "php-fpm -t" ]
- interval: 10s
- timeout: 3s
- retries: 3
- command: ["php-fpm", "-F"]
- build:
- context: .
- dockerfile: php/Dockerfile.php-fpm
- depends_on:
- - yeda.postgres
- - yeda.redis
- restart: always
- env_file:
- - .env
- volumes:
- - ./php/php-fpm.d:/usr/local/etc/php-fpm.d
- - ./php/php.ini:/usr/local/etc/php/php.ini
- - ../yeda-php:/var/www/html
- - php_fpm_socket:/run/php
- networks:
- - yeda_php_network
- yeda.nginx:
- container_name: yeda.nginx
- labels:
- - "traefik.enable=true"
- - "traefik.http.routers.yeda.rule=Host(`new.yeda-college.co.il`)"
- - "traefik.http.routers.yeda.entrypoints=websecure"
- - "traefik.http.routers.yeda.tls.certresolver=letsencrypt"
- - "traefik.http.services.yeda.loadbalancer.server.port=80"
- - "traefik.http.routers.yeda-http.entrypoints=web"
- - "traefik.http.routers.yeda-http.rule=Host(`new.yeda-college.co.il`)"
- - "traefik.http.routers.yeda-http.middlewares=https-redirect"
- - "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- - "com.datadoghq.ad.logs: '[{\"source\": \"nginx\", \"service\": \"nginx\"}]'"
- build:
- context: .
- dockerfile: nginx/Dockerfile
- restart: always
- depends_on:
- yeda.php-fpm:
- condition: service_healthy
- volumes:
- - ./nginx/templates:/etc/nginx/templates
- - ../yeda-php:/var/www/html
- - ../yeda-data/certs:/etc/ssl/certs
- - php_fpm_socket:/run/php
- networks:
- - yeda_php_network
- yeda.postgres:
- image: postgres:latest
- container_name: yeda.postgres
- labels:
- - "com.datadoghq.ad.logs: '[{\"source\": \"postgresql\", \"service\": \"postgres\"}]'"
- restart: always
- #ports needed only for migration, remove after full migration from DO to HZ
- ports:
- - "5432:5432"
- env_file:
- - .env
- volumes:
- - ../yeda-data/postgres:/var/lib/postgresql/data
- environment:
- POSTGRES_DB: ${POSTGRES_DB}
- POSTGRES_USER: ${POSTGRES_USER}
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- TZ: UTC
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
- interval: 30s
- timeout: 5s
- retries: 5
- networks:
- - yeda_php_network
- command:
- - "postgres"
- - "-c"
- - "max_connections=200"
- - "-c"
- - "shared_buffers=15GB"
- - "-c"
- - "effective_cache_size=45GB"
- - "-c"
- - "maintenance_work_mem=2GB"
- - "-c"
- - "checkpoint_completion_target=0.9"
- - "-c"
- - "wal_buffers=16MB"
- - "-c"
- - "default_statistics_target=100"
- - "-c"
- - "random_page_cost=1.1"
- - "-c"
- - "effective_io_concurrency=200"
- - "-c"
- - "work_mem=19660kB"
- - "-c"
- - "huge_pages=try"
- - "-c"
- - "min_wal_size=1GB"
- - "-c"
- - "max_wal_size=4GB"
- - "-c"
- - "max_worker_processes=30"
- - "-c"
- - "max_parallel_workers_per_gather=4"
- - "-c"
- - "max_parallel_workers=30"
- - "-c"
- - "max_parallel_maintenance_workers=4"
- yeda.redis:
- image: redis:latest
- container_name: yeda.redis
- restart: always
- volumes:
- - ../data/redis:/data
- healthcheck:
- test: ["CMD", "redis-cli", "ping"]
- interval: 30s
- timeout: 10s
- retries: 5
- networks:
- - yeda_php_network
- yeda.queue-worker:
- image: ghcr.io/yeda-colleges/yeda-php-cli:8.2
- container_name: yeda.queue-workers
- labels:
- - "com.datadoghq.ad.logs: '[{\"source\": \"php\", \"service\": \"laravel-worker\"}]'"
- restart: always
- depends_on:
- - yeda.redis
- - yeda.postgres
- env_file:
- - .env
- volumes:
- - ../yeda-php:/var/www/html
- command: php /var/www/html/artisan queue:work --timeout=90 --memory=1000 --tries=3
- deploy:
- replicas: 1
- networks:
- - yeda_php_network
- yeda.scheduler:
- container_name: yeda.scheduler
- labels:
- - "com.datadoghq.ad.logs: '[{\"source\": \"php\", \"service\": \"laravel-scheduler\"}]'"
- image: ghcr.io/yeda-colleges/yeda-php-cli:8.2
- restart: always
- env_file:
- - .env
- volumes:
- - ../yeda-php:/var/www/html
- entrypoint: ["/bin/sh", "-c", "while :; do php /var/www/html/artisan schedule:run; sleep 60; done"]
- networks:
- - yeda_php_network
- yeda.composer:
- container_name: yeda.composer
- build:
- context: .
- dockerfile: ./php/Dockerfile.composer
- volumes:
- - ../yeda-php:/var/www/html
- working_dir: /var/www/html
- command: composer install --optimize-autoloader --no-dev
- networks:
- - yeda_php_network
- datadog:
- image: gcr.io/datadoghq/agent:latest
- depends_on:
- - yeda.nginx
- - yeda.php-fpm
- - yeda.queue-worker
- - yeda.scheduler
- - yeda.traefik
- container_name: datadog
- restart: always
- env_file:
- - .env
- environment:
- DD_API_KEY: ${DD_API_KEY}
- DD_SITE: datadoghq.eu
- DD_APM_ENABLED: "true"
- DD_LOGS_ENABLED: "true"
- DD_PROCESS_AGENT_ENABLED: "true"
- DD_DOGSTATSD_NON_LOCAL_TRAFFIC: "true"
- DD_CONTAINER_EXCLUDE: "name:datadog"
- DD_PROCESS_CONFIG_ENABLED: "true"
- DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED: "true"
- DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL: "true"
- DD_CONTAINER_LOGS_ENABLED: "true"
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock:ro
- - /proc/:/host/proc/:ro
- - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
- networks:
- - yeda_php_network
- volumes:
- php_fpm_socket:
- networks:
- yeda_php_network:
- driver: bridge
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement