Files
compose/docker-compose.yml
2026-02-16 14:12:35 +03:30

143 lines
3.4 KiB
YAML

services:
# backend_db:
# image: postgres:17-alpine3.21
# container_name: backend_db
# tty: true
# restart: unless-stopped
# ports:
# - "8050:5432"
# environment:
# POSTGRES_DB: ${POSTGRES_DB}
# POSTGRES_USER: ${POSTGRES_USER}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# volumes:
# - backend_db_data:/var/lib/postgresql/data
# profiles:
# - server
# 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
profiles:
- server
networks:
- crm_network
notification_db:
image: docker.arvancloud.ir/postgres:17-alpine3.21
container_name: notification_db
tty: true
restart: unless-stopped
ports:
- "8070:5432"
environment:
POSTGRES_DB: ${NOTIFICATION_SERVER_DB}
POSTGRES_USER: ${NOTIFICATION_SERVER_USER}
POSTGRES_PASSWORD: ${NOTIFICATION_SERVER_PASSWORD}
volumes:
- notification_db_data:/var/lib/postgresql/data
profiles:
- server
networks:
- crm_network
redis:
image: docker.arvancloud.ir/redis:7-alpine3.21
container_name: redis
restart: unless-stopped
tty: true
profiles:
- server
networks:
- crm_network
laravel:
build:
context: ${LARAVEL_PROJECT_PATH}
dockerfile: Dockerfile
container_name: laravel
tty: true
restart: unless-stopped
ports:
- "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:
# Host DB connection
DB_CONNECTION: mysql
DB_HOST: host.docker.internal
DB_PORT: 3306
DB_DATABASE: roaddb
DB_USERNAME: root
DB_PASSWORD: WitelDB
profiles:
- server
networks:
- crm_network
notification_server:
build:
context: ${NOTIFICATION_SERVER_PATH}
dockerfile: Dockerfile
container_name: notification_server
restart: unless-stopped
environment:
- NODE_ENV=production
- DB_HOST=notification_db
- DB_PORT=5432
- SERVICE_URL=${NOTIFICATION_SERVICE_URL}
- DB_USERNAME=${NOTIFICATION_SERVER_USER}
- DB_PASSWORD=${NOTIFICATION_SERVER_PASSWORD}
- DB_DATABASE=${NOTIFICATION_SERVER_DB}
- DB_SSL=${NOTIFICATION_SERVER_DB_SSL}
- DB_SYNC=${NOTIFICATION_SERVER_DB_SYNC}
- PORT=${NOTIFICATION_SERVER_PORT}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3023:${NOTIFICATION_SERVER_PORT}"
profiles:
- build
networks:
- crm_network
nextjs:
build:
context: ${NEXT_JS_PATH}
dockerfile: Dockerfile
container_name: nextjs
env_file:
- ${NEXT_JS_PATH}/.env
ports:
- "3106:3000"
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
profiles:
- build
networks:
- crm_network
volumes:
notification_db_data:
driver: local
# backend_db_data:
# driver: local
networks:
crm_network:
driver: bridge