From 30361d4f4ac9cbd37597f5368f40b2cff834e8d1 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Mon, 16 Feb 2026 11:36:48 +0330 Subject: [PATCH] add nginx container --- docker-compose.yml | 15 +++++++++++++++ nginx/crm.conf | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7c0dab3..1c99c84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,20 @@ services: # networks: # - crm_network + nginx: + image: nginx:stable-alpine3.23-perl + container_name: nginx + restart: unless-stopped + ports: + - "8000:80" + volumes: + - ./nginx/crm.conf:/etc/nginx/conf.d/default.conf + - ${LARAVEL_PROJECT_PATH}:/var/www/crm/backend + depends_on: + - laravel + networks: + - crm_network + notification_db: image: docker.arvancloud.ir/postgres:17-alpine3.21 container_name: notification_db @@ -56,6 +70,7 @@ services: - "9000:9000" volumes: - ${LARAVEL_PROJECT_PATH}:/var/www/crm/backend + - /var/spool/asterisk/monitor:/var/www/crm/backend/storage/app/public/recordings extra_hosts: - "host.docker.internal:host-gateway" # Enables host DB access environment: diff --git a/nginx/crm.conf b/nginx/crm.conf index 2c9d405..f2ddcb5 100644 --- a/nginx/crm.conf +++ b/nginx/crm.conf @@ -7,11 +7,16 @@ server { include fastcgi_params; fastcgi_pass laravel:9000; fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME /var/www/laravel/public/index.php; + fastcgi_param SCRIPT_FILENAME /var/www/crm/backend/public/index.php; } location / { proxy_pass http://nextjs:3106; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } location /notification {